Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Who Needs Direction?

This thread is locked; no one can reply to it. rss feed Print
Who Needs Direction?
OnlineCop
Member #7,919
October 2006
avatar

Onewing said:

Could the original poster edit his post to contain links to important posts/links...

MiquelFire said:

...yea, that would be useful.

Good idea. Original post edited.

Trezker
Member #1,739
December 2001
avatar

Finally, I did some work on monday. Though it was not much...
I added a Load_map function that's bound to lua, so an entity can load a new map now.

The problem now is that entities are still pretty limited, so some new features need to be added.

  • Entity properties, so you can use the same script but set different values to the entities

  • Optional entity collision

Scripts triggered on entering and leaving entity

  • Specifying entities in map files

  • Entities that belong to a map

Then I'd also like to have a system for entity prototypes.

EDIT:

  • Done

bamccaig
Member #7,536
July 2006
avatar

Trezker, in the (other) Monday thread said:

I'll show you what I mean if someone other than me decides to post in the Monday thread again.

You could always append to your post and "Send to Top". ;)

OnlineCop
Member #7,919
October 2006
avatar

Hey all.

I haven't been able to hold together a coherent thought for a few weeks now, so haven't really been able to contribute much.

I've been dinking around with an idea with that whole "worlds->maps->levels->layers" approach, and have committed a few times to the SVN. It isn't graphical or tied to Allegro yet, but I figure that if I can get "something out there" that will let us make some nice maps, map transitions, etc., I'd at least feel better (even if it's not 100% on-track with what we're trying to do with the Monday project per-se).

They're in their own little subdirectory: branches/onlinecop/src/DataLoader.

There's a makefile there that should let you build it (see the README.TXT, though, because you have to move/rename two of the three "Test" sources in the src/ directory), and all the config scripts that should let you see a bunch of maps for a single world.

I've tried to highly comment the code (more for my sake than yours, because I've been having a heck of a time understanding what was going on mere hours after writing the code myself), and added a few text files here and there to explain my direction.

Now that my mental capacities are coming back slowly, I'll once again try to figure out what I'm supposed to be doing ::)

Oh, and if any of you DO check it out, give me feedback... even if it's "that's a crappy waste of crappity crap-crap!" ;D I'd like to know if it works/breaks on others' systems, and whether it looks like a viable approach. If it's not at all viable, I can just scrap it and put it in some code archive somewhere to be used in a future crap-project...

Trezker
Member #1,739
December 2001
avatar

I have kind of intended to get around to taking a look at your code...
In general I feel like I haven't been a very good lead programmer.

Lead programmer shouldn't do any programming at all, he should just be a manager that makes sure tasks are organized and keeps track of everything. Since I'm a really good programmer that'd be a waste...

It'd be better to have a lead programmer that isn't so much a talented programmer as a talented listener. He doesn't need to come up with solutions either, for that he can ask the programmers how they think things should be done.

Anyway, I should write about what I promised in the other thread.
I came up with this very simple format to use for entities in the .map files.

<entity>
x = 192
y = 192
interact = Maploader
map = media/test.map string
</entity>

As you can see, everything is attribute = stuff. So it real simple.
In the engine these attributes are handled according to what they're for. Attributes that exist in the Entity class are set accordingly, in this example we have position and an interact script.

The rest of the attributes, anything that the Entity class doesn't do anything with, is set as attributes belonging to the entity instance in Lua. These attributes need to have a type so the engine knows how to set it in lua, that's the "string" part of the map attribute.

I've made a table called this available in the lua state. The attribute "map" has been set for the particular instance in this example. So, that Maploader script that's activated on interaction looks like this.

function Maploader(instance, container)
  Load_map(this[instance].map);
end

OnlineCop
Member #7,919
October 2006
avatar

The format that you've done, and my little "config scripts side-adventure" format, look very similar. In fact, my format is just missing the equals signs. It's more of the format:

line_identifier
some_path
some_id
x_coord y_coord

line_identifier
some_path
some_id
x_coord y_coord

...

The only difference, I think, is that yours allows the flexibility that if one of those lines, like "map = media/test.map string", is missing, it simply ignores it and uses default values, while mine will only add data where a specific "line_identifier" is found... but the order in which stuff is read in is still fixed.

I like your approach, having the assignment operator in there, and everything under a general-purpose header (wrapped within the <...> and </...> tags), though we'll have to see.

Something I really like that you have in your branch was how you handle movement collision: I like how it's circular instead of square. It makes walking around objects by "bumping into them" flow very smoothly.

Trezker: do you want to be taken off as the Lead Programmer and put in as "talented programmer" instead? If so, we need to nominate someone else ;)

Trezker
Member #1,739
December 2001
avatar

Maybe I should also reveal that the attributes are first read in and then processed in a prioritized order.

I also want to add a template system for when many entities that share some attributes you can do. But I haven't figured out the solution for this yet. Perhaps add <template></template> tags...

As for the circle collision, yes it's nice. But it isn't perfect, you can push stuff around and through walls when multiple objects get involved. We can fix that later though.

On the lead programmer issue, yes I think we need to find someone more motivated to organize people. But that's up to the group, if people don't find a better guy for the job I'll just keep doing what I've been doing.

23yrold3yrold
Member #1,134
March 2001
avatar

Guess I should speak up so people know I'm still alive. I'm happy something is still happening with the code. Maybe at this point we should draw a line under what we've done, what needs doing, and open up to the community for help though? Remember, this isn't supposed to be a group project so 3-4 guys can burn out doing all the work. It's supposed to be something everyone can contribute to if they want, for the sake of a new game, and for the challenge of the team effort.

Trezker, instead of writing all this code, is there any way you can just organize what needs to be done, maybe write some basic class interfaces only, instead of implementations, and let the forum at large know what blanks need to be filled? I wish I could be more hands-on there, I never did get Allegro 5.0 working and I haven't had a chance to take a fresh stab at it. I'll try to get it installed again in the next few days, and hope other people don't have this kind of trouble ....

--
Software Development == Church Development
Step 1. Build it.
Step 2. Pray.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

I'll try to get it installed again in the next few days, and hope other people don't have this kind of trouble ....

Initial A5 releases were a little harder to install than needed, but current releases should be a snap so long as you don't need iio or acodec support ;) Oh, Trent put up some pre built mingw binaries of a recent SVN snapshot, it seems he's versioned it 4.9.6.5.
http://www.allegro5.org/

That said, if all you guys need is an organizer I can help with that. Just get whats done written down and I can try and heard you guys around. And even help people with A5 install problems if necessary.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

bamccaig
Member #7,536
July 2006
avatar

Trezker said:

<entity>
x = 192
y = 192
interact = Maploader
map = media/test.map string
</entity>

<entity>...</entity> looks a lot like XML. And if that's the case then why not do the whole file in XML?

<entity>
    <x type="int">192</x>
    <y type="int">192</y>
    <interact type="string">Maploader</interact>
    <map type="string">media/test.map</map>
</entity>

Surely there is somebody with the XML background to make that happen. With a schema or the like you could easily make sure the configuration files were "valid" before using them too.

Otherwise, you could get away with a simpler format like OnlineCop's or replace the entity delimiters with a single header.

[entity1]
x=192
y=192
interact="Maploader"
map="media/test.map"

[entity2]
x=322
y=322
interact="Maploader"
map="media/test2.map"

When you see a line surrounded by square brackets (or the delimiters of your choosing) you know you're starting a new entity. Also, I like the #-character comment convention found in many UNIX-like configuration files because it's simple and effective. That would allow you to drop comments in the files, which can often be useful.

This is all m00t if you've already implemented the format, however.

/2¢

OnlineCop
Member #7,919
October 2006
avatar

23yrold3yrold said:

I wish I could be more hands-on there, I never did get Allegro 5.0 working

...which is one of the main reasons I worked on my little "config files side adventure" thing... no Allegro required (still having random and weird a5 compile errors... sigh).

bamccaig said:

I like the #-character comment convention found in many UNIX-like configuration files because it's simple and effective. That would allow you to drop comments in the files, which can often be useful.

That's almost exactly what my format does: # starts lines as comments. If you haven't already taken a look, see what it looks like (you'll find this "working code" under ./branches/onlinecop/src/Data[something]/src).

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

still having random and weird a5 compile errors... sigh

http://www.allegro5.org ftw

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Trezker
Member #1,739
December 2001
avatar

I just downloaded NaturalDocs to try it out with the project and it's pretty nice.
But then we have to actually document everything... :-[

With docs in the repository maybe it'll be easier for people to see what's been done. We could also maintain todo lists and whatnot with it.

Is there any good reason not to add NaturalDocs to the project?

OnlineCop
Member #7,919
October 2006
avatar

Trezker: I'll vote in favor of NaturalDocs.

Thomas: I used that link to download the allegro DLLs and libs/headers. I'll try compiling something Monday-related with Allegro soon.

EDIT:

Updated original post, adding Thomas Fjellstrom as the official Cat Herder.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Updated original post, adding Thomas Fjellstrom as the official Cat Herder.

I can't really start till I know whats been done, whats where, and what needs done...

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Trezker
Member #1,739
December 2001
avatar

That's why we should probably put some effort into documentation now. Mostly my job since I wrote most of the code we have...

I added NaturalDocs in svn now, not sure the structure I decided for it the best...
It builds nicely with scons, may need to pass rebuild_docs=1 though. I haven't added it to the makefile.

But there's also the question about making the docs publicly viewable. I don't know how we should arrange that.

Thomas Fjellstrom
Member #476
June 2000
avatar

I can host anything on strangesoft.net if you need (except svn, that would have to go on svn.tomasu.org). email, email lists, web space, etc.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

weapon_S
Member #7,859
October 2006
avatar

23yrold3yrold said:

I'm loath to set deadlines because as you can see, things come up in real life

That's why I said "periodic evaluation" at first. But I didn't think you would get that. What I mean is:
"Go make the sounds. You have two weeks. "

"Sure thing, boss."
Two weeks later:
"Where are my sounds?"
"Something came up..."
"Can you have them in a week?"
The key is doing this openly. You seem starting to realize it isn't a team project you're doing, but a community project. Very different organization.

Fladimir da Gorf
Member #1,565
October 2001
avatar

With so many config file and XML loaders on earth that you can't ever even count them, who'd write their own? I'd focus on the gameplay aspects as not only it's the important part, but also getting a working skeleton will encourage the others.

OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori)

Trezker
Member #1,739
December 2001
avatar

I have made docs for the source code now. At least the stuff I've written, though I left out some parts that are likely removed in the future. I also let code and docs todo files into the documentation.

The svn doesn't hold a built documentation now, you need to build it yourself. Either with scons:
scons rebuild_docs=1
Or direct NaturalDocs call:
../NaturalDocs/NaturalDocs -i include -i src -i docsrc -o HTML docs -p nd -ro

Since it's the first round of docs, it has been written hastily. So feedback on it is welcome. Of course it would be beneficial to host the docs on a public site so not everyone has to checkout from svn and build it.

Thomas Fjellstrom
Member #476
June 2000
avatar

Quote:

Since it's the first round of docs, it has been written hastily. So feedback on it is welcome. Of course it would be beneficial to host the docs on a public site so not everyone has to checkout from svn and build it.

Can you send me what you've built? I can put them up some place.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

MiquelFire
Member #3,110
January 2003
avatar

I could add a hook to regenerate the docs, but I need to figure out how I want to handle it though (seeing as I'm not hosting a public site for Monday currently).

If someone has a server that just requires the hook on my end to call a web page, let me know. [edit] Like maybe you Thomas.

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red | +Me
Windows 8 is a toned, stylish, polished professional athlete. But it’s wearing clown makeup, and that creates a serious image problem. ~PCWorld Article

Thomas Fjellstrom
Member #476
June 2000
avatar

I can probably get my strangesoft.net host to build them automatically every day or so.. I KNOW I can get my local server to do it, but eh.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Trezker
Member #1,739
December 2001
avatar

I just remembered I have my own little place on bafserv, and until we have a proper automated publishing service I may just as well put it there.

http://trezker.bafserv.net/monday/docs/index.html

Thomas Fjellstrom
Member #476
June 2000
avatar

Would it be possible to get all you guys with code, and code in branches to put together a list of whats been done, and what needs done? At that point I can start going through 23's game plan and see if theres anything missing.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730



Go to: