|
real time battle system... Displaying 1-5 of 5 total.
1
Ulver
|
First off, im not a programmer. Ive taken a few Pascal classes so I have a basic understanding of how programming works.. functions, arrays, variables, etc.. But even with this basic knowledge it seems the scripting side of my game will undoubtedly be the most painful.
Im hoping to make a real time BS of sorts. there really is no 'battle mode'. The idea is you just wander around and there are creatures scattered all over the map. The creatures will try to attack you, but you dont have to fight them if you dont want to. You can always run, but this wont get you any xp.
It seemed kinda easy at first. When player presses button the CHR goes through an attack animation and is unmovable while in this animation. Any creature within X distance from CHR gets hit by sword and takes damage. All this I could probably do on my own with a little fiddling and a lot of patience/reading... but the main problem is where to start...
How do you define something as an enemy? For starters I was just gonna put generic unmoving unattacking slimes on a map and have them disappear when you hit them.. just to see if I can get that to work. But Im having trouble figuring out how to go about this. How do you tell the game what is a killable thing and what is just art on the map... And then how would i place these enemies on the map? Im guessing I would do the entity spawn command... do that a bunch of times and scatter the slimes at various coordinates... that would just plop down sprites. How would I make them hittable entities?
IF player within X distance from slime09 DO
IF player in attack animation DO
remove slime09
just thinking out loud. Thats the best way I can think of making entities "hittable" as of now. its a simplified conceptualization of course... id have to read thru all the docs again and make that readable by VCC. and it would have to run over and over again during the whole time your playing.. or something.. Am I on the right track? Or am I just making a fool of myself?
Sigh. then theres the whole AI thing... getting the creatures to attack you... somehow keeping up with HP... I hated those programming classes. :o\
Posted on 2001-07-26 18:01:21
|
Zeke
|
I would try to visualize the sequence going something like this:
1. The player hits the "attack" key and activates your script.
2. You get the coordinates of the player with enity[player] (you'll probably want the tile coordinates)
3. You get the coordinates of spaces where, if there is an enemy, it will be destroyed (or injured). In other words, the spaces you want the player's sword to swing through. Save these coordinates in an array.
4. You start going through the entsoncreen array, getting the coordinates for entity[entsonscreen[i]], where i goes from 0 to numentsonscreen
5. If i == player, skip ahead until you get back to 4 again.
Here's the part you asked about. We need a way to know if this entity we now have the coordinates for is "hittable". I'd suggest creating your own array of entity indeces, and putting the indeces of every enemy into this array when the map is first loaded (or when the enemy is first added to the map if it isn't supposed to be there when you start. So, at this point what you want to do is check to see if the entity you have now is in this array. So...
6. Go through the "hittable entities" array one by one. If you find entsonscreen[i] in this array, you have a hittable entity. If not, skip over the rest of this.
7. So now we have an entity we know is onscreen and hittable. All we have to do is see if its coordinates match any of the places you have saved in step 3 (the spaces the player is hitting).
8. If we have a match, the enemy is hit. Act accordingly (take away HP, whatever).
9. Repeat until you have gone through all the nested loops up there.
There are plenty of places were this method could be tweaked probably, but that's all I can think of right now. Does anybody know if I left something out?
Well, good luck.
Posted on 2001-07-26 21:11:21
|
Ulver
|
Duh! *smacks head* You make me feel stupid. I was wondering how I would constantly check if a creature was in front of the character. I dont need to constantly check! Just check everytime the player hits the attack button, just like you said. I fail to see the simple way to do things. Heh this is why I got bad grades in those programming classes.
Ill try writing something up later tonight, right now im messing with sprites. Ill undoubtedly be back with a zillion questions/problems. hehe.
Thanks for the help. Things are looking a bit clearer now.
Posted on 2001-07-26 22:24:42
|
Hatchet
|
I wrote a little HoV game called Rex that uses a realtime battle system like the one you described. It's not the best coded one, since I had to do it within a time limit, but it should be enough to get you started if you need it. I uploaded it to www.mastercain.com/hatchet/Rex.zip
Hope that helps you, and feel free to ask/e-mail any questions you may have. :)
-Hatchet
Posted on 2001-07-28 02:05:07
|
Ulver
|
Nice! I took a quick peek through your .vc files... i get the general idea of how you’ve got it set up... ill cook my brain over it later. This will be a BIG help for me. Thanks. :)
Is it really hard to make monsters smarter? Like give them cone shaped line of sight and make them chase you once they’ve spotted you... the first one I think I could do.. the second I have no idea how to go about.
Its easy to dodge the enemies in REX, but it has the best real time battle system ive seen in a verge game. I’ve only seen one other actually and it was... worse... Everyone goes for turn based it seems, I’m sure for a good reason.
I think ill keep it simple for now and try to emulate your system. :) Unfortunately I leave for college tomorrow and wont have access to my computer for the next 3 weeks. :(
Posted on 2001-07-28 21:26:45
|
Displaying 1-5 of 5 total.
1
|
|