(07-05-2014, 06:05 PM)Bamboori Wrote: so the entire data handling will be done via .ini files.Looks promising! Not really sure what you meant by "create a dummy object for every possible", but that sounds more like allocating an array of your object's type for all the objects that are going to be loaded; and that's how it was done with LF2 as well. But let me share my thoughts :P:
.txt and .bin would work as well, but i'd need to parse everything, whereas in ini files i can read out variables way easier.
....just as i was writing down my current method i realized it could be done way easier
right now i would have to create a dummy object for every possible object/background/char etc.
ill see what i can manage to come up with.
right now my method would be:that would also mean that the 'id' would be limited to exactly 0-999.
- a set of lets say 1000 dummy objects, each named 0-999.
- for every 'id' there would only be a path for the .ini file.
- in the .ini file there would be an identifier section, which then would copy the type of the data (background/char etc) to the corresponding dummy object.
im not too sure whether i will include backgrounds in this as they are coded differently altogether.
im not really sure about backgrounds at all yet tbh
1-Allocate an array of type "object" for the game objects, another array of type "bg" for the bgs, and a 3rd one of the type "object_copy" that stores info about objects on the screen.
2-The "object" array will store the actual objects that are loaded fir the game; including the frames, sounds and the sprites.
3-The "object_copy" array, however, will store data and info about objects on the screen (its current frame, x_y_z_position, the current HP, MP, x_y_z_velocity, the key clicks buffer..etc).
4-In your object[xyz].update() function, set a parameter of type "object_copy" to pass the data of that object on the screen; You surely don't want to load bandit's sprites and stuff 3 times in order to have 3 of them on the screen. You will just load it once, and then create 3 instances of "object_copy" that stores each one's position, hp and etc.
Goood Luck! (finally getting to the fun part, eh?)
Edit: Plus I think that actually specifying the ids like that makes more sense, since an id is supposed to act like the "address" of an object/oranything. Plus it can force modifiers to be more organized.
A-Engine: A new beat em up game engine inspired by LF2. Coming soon
A-Engine Dev Blog - Update #8: Timeout