Battle Engine - Alpha 6 release, downloads in first post

Ideas and games that are not yet publicly in production. This forum also contains the pre-2012 archives of the Works in Progress forum.
Message
Author
Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#121 Post by Jake »

blakjak wrote:btw, is the little guy's frame speed matching the one from the fighterclass' movement ?
Possibly not - I hope to make the movement rates variable, as a parameter to the MoveSkill when you create it, so you can adjust it to suit.

I'll need to look into custom move transitions a bit more before then, though. I'd really like the parameter to decide what pixels-per-second rate to use for the move (so a character with a move rate of 100 would take 2 seconds to complete a 200-pixel move) but that would depend on being able to relatively easily make Ren'Py vary the length of the move transition by an arbitrary amount. I don't think it should be difficult, but presently I'm just using a fixed-time move transition and I've not looked into it at all recently.
Server error: user 'Jake' not found

blakjak
Veteran
Posts: 224
Joined: Fri Dec 21, 2007 2:36 pm
Location: France
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#122 Post by blakjak »

Oh yes, that would be perfect. Pixels-per-second rate would make it possible to give fighters character, through the way they move.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#123 Post by Jake »

It's not entirely easy to tell right now, since I'm just using tinted versions of the same sprite to test the facings code, but these screenshots of Bob walking around in a circle demonstrate that the engine now maintains a facing direction for each Fighter, and the sprite can be set up to display differently for different facings (falling back on defaults if they're not defined)...
facings.gif
facings.gif (62.59 KiB) Viewed 1540 times
(Disco isn't dead!)
Server error: user 'Jake' not found

blakjak
Veteran
Posts: 224
Joined: Fri Dec 21, 2007 2:36 pm
Location: France
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#124 Post by blakjak »

Bob, you're such a macho man! :3

Sorry for the senseless post (-_-);

Jaye
Regular
Posts: 30
Joined: Sun Mar 15, 2009 2:54 am
Projects: A South Park Love Sim & Original Visual Novel Game
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#125 Post by Jaye »

Wow! Alpha release.

This was such a great help, I actually have a chance of having a minibattle ingame now. *yay*


Erm, not to be ungreatful but...

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


On line 150 of E:\renpy-6.9.0\Battle System TEST/game/script.rpy: indentation mismatch.

Ren'Py Version: Ren'Py 6.9.0f
:cry:
Two games in the making!

"Running-with-scissors is my middle name!" -Me

"I'd kiss you but you'd kill me." -Chuck (From Pushing Daisies)

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#126 Post by Jake »

Jaye wrote:

Code: Select all

script.rpy: indentation mismatch.
:cry:
This will be a compile-time problem with your script.rpy file - without seeing the code in question, it's pretty hard to diagnose...
Check the indentation of all of your lines, remembering that each block of code - any code following a line ending in a colon, that's supposed to be dependent on that line - should be indented to the same distance, and that distance should be greater than the indentation of the line-with-a-colon that the block belongs to.

The error suggests that your problem is on line 150, so check around there; bear in mind, though, it could be the line before which actually is out of alignment with the rest.
Server error: user 'Jake' not found

User avatar
curry nochi rice
Miko-Class Veteran
Posts: 746
Joined: Sat Mar 27, 2010 3:12 am
Projects: Delicatessen, Whom to Notice, Start of Something, Love Sorcery
Organization: Circle Cosine
IRC Nick: Curry
Skype: after.curry.rice
itch: project-rothera
Contact:

Re: Battle Engine - Alpha 1 release, downloads in first post

#127 Post by curry nochi rice »

Jake,

I'm loving this engine for tactical turn-based card games. I'm loving it.
but I'm getting nosebleeds by encoding so much data like unit sizes, types, numbers and stuff.
Working with Artillery ranges and support as well.

and it doesn't involve figures, just unit symbols and attacks would just be plain flanking (depends on the unit type) and manoeuvres, had to study military manoeuvres to do so.

actually, I just planned on using image-maps and ATL for the job, but it would be too long.
Personal (R-13) | Now at IndieDB | Circle Cosine's itch.io
I wanna be done.

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#128 Post by Jake »

I've just uploaded an alpha 2 release of the battle engine:

Battle Engine Alpha 2 - All platforms - 21MB

More details in the first post, but the main new features in this release are:

- Facing-dependent states for sprites, so you can animate a guy walking in whichever direction he's actually walking (and demonstration of such)
- CustomSchema class to make it easier to pick-and-mix functionality
- More configurable scenery and battlefields (with AddRect and RemoveRect methods for grid battlefields, albeit not in any demo)

(No panning yet; I'll need 6.11 stuff to do it, and I didn't want to make the whole thing 6.11 only just yet, not until the kinks have been worked out of that release. Also no fighter-specific-setting-of-move-rates, but it's on my to-do list; I'm off to the US on business for a week now, and I wanted to get a release uploaded before I left.)
Server error: user 'Jake' not found

Ren

Re: Battle Engine - Alpha 2 release, downloads in first post

#129 Post by Ren »

[youtube]<object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/OCDJtIj-TYA&hl ... ram><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OCDJtIj-TYA&hl=en_GB&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>[/youtube]

Jake didn't have the time to prepare a demonstration to show you, so here you go. :3

blakjak
Veteran
Posts: 224
Joined: Fri Dec 21, 2007 2:36 pm
Location: France
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#130 Post by blakjak »

Wow ! This is wonderful, and so fast. So finally we can test our walking sprites now. I'm so happy. Thanks Jake for v2 and thanks Ren for the exemple, it seems to work perfectly =)

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#131 Post by DaFool »

Thanks for the update.

If I may request another feature, namely shortcut keys for keyboard mapping? This will make it easier to port the game to handheld devices such as Pandora.

Arrow Keys will naturally map to D-Pad. Mouse movements to the Left Analog Stick. As for the buttons, this is where it gets tricky.

Here is Nintendo DS's layout with commands for Final Fantasy Tactics:

Code: Select all

    X  -> main menu

Y       A-> confirm selection

    B -> cancel selection
Here is the keymapping for Pandora:

Code: Select all

      Y(Page Up)

A(Home)    B(End) 

      X(Page Down)

Assuming we would apply FF Tactics default control, this is similar to the button positioning for the Asian PS3 while playing Disgaea. Thus the keys mapping should be End for Confirm Selection and Page Down for Cancel Selection.

However I know that Western PS3s have the Confirm and Cancel buttons the other way around. I don't have a DS but I also need to check if western Nintendo DS have the Confirm button as the bottom button (B in this case) and the Cancel button the east button (A in this case).

Additionally, L/R might come in useful especially in the Inventory screen where the they cycle through characters. In Pandora's case, L is Right Shift (don't know why; that's what they said) and R is tied to Right Control.

In any case, a Ren'Py game with this keymap and 800x480 resolution should already be playable on Pandora, as-is.

User avatar
DaFool
Lemma-Class Veteran
Posts: 4171
Joined: Tue Aug 01, 2006 12:39 pm
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#132 Post by DaFool »

Jake, will diagonals be allowed in the future version? It will feel more natural than walking in a zig-zag fashion, but I'm guessing the path-finding must be more difficult.

I already have rotations in 8 different directions, but by the looks of things I can either use 4 of the perpendicular positions for a non-iso grid and the remaining 4 of the 45-degree-rotated positions for the isometric grid.

Also, it's neat that you were able to cut down the walkcycle to 6 frames. I tried that also and the result wasn't too bad. I started off with frames 1-15 (the 16th frame is the same as frame1) and ideally would cut down to frames 1-7(8th frame same as first), but with an odd number of frames it must not divide evenly when calculating the speed that the animation should slide around.

I also noticed that with a basic isometric N,S,W,E format that you have, W and S can flip to each other (provided that the pose is symmetrical) and N and E can flip to each other as well, so one only needs to animate two walkcycles. With a non-isometric setup, you can only flip W and E.

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#133 Post by jack_norton »

Congrats, have been following this since early builds and wow it has really improved. Once you add hex-grid and renpy 6.11 support (once reaches stable build) I'll be really interested in using it :)
follow me on Image Image Image
computer games

Jake
Support Hero
Posts: 3826
Joined: Sat Jun 17, 2006 7:28 pm
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#134 Post by Jake »

DaFool wrote:Jake, will diagonals be allowed in the future version? It will feel more natural than walking in a zig-zag fashion, but I'm guessing the path-finding must be more difficult.
Diagonals are already allowed, and since I use a very generic graph for my pathfinding rather than having written an algorithm specifically for a squared grid, it's no harder or less hard with them enabled. Just take a look at grid_demo.rpy - pass "diagonals=True" instead of "diagonals=False" when constructing the GridBattlefield and it'll allow movement across the diagonals. Presently it costs exactly the same to move left one square as it costs to move diagonally up and left one square, because I've not introduced any kind of movement costing yet, but when that does come along I'll also include an optional 'diagonal cost' parameter that allows you to choose how much extra it costs (if anything) to move diagonally.

(I turned diagonals off for the demo just because I liked having quite a few MP for play-around testing and giving people 5MP on such a small map and allowing diagonals basically meant "pick where you want to stand". I realised when I did it that a lot of my favourite tactics games don't actually allow diagonal movement anyway. ;-)

Just bear in mind that if you want to use facings, the default for a grid is N, S, E and W; you'll need to pass your new facings into the GridBattlefield constructor as well, in a dictionary mapping a string facing name to a tuple with the start and end of the arc that facing describes.

The default for GridBattlefield is this:

Code: Select all

facings={'N':(-45, 45), 'E': (45, 135), 'S':(135, 225), 'W':(225, 315)}
but if you wanted eight-way facings, you'd probably want to pass in something more like this:

Code: Select all

facings={'N' :(-22.5, 22.5),'NE' :(22.5, 67.5),'E' :(67.5, 112.5),'SE' :(112.5, 157.5),'S' :(157.5, 202.5),'SW' :(202.5, 247.5),'W' :(247.5, 292.5),'NW' :(292.5, 337.5)}
You can see a practical example if you change line 191 of grid_demo (in alpha 2) to read as follows:

Code: Select all

battlefield = GridBattlefield(fieldSprite, origin=(362, 441), gridSize=(6,5), spaceSize=(75, -38), offsets=(-75, -38), diagonals=True, facings={'N' :(-22.5, 22.5),'NE' :(22.5, 67.5),'E' :(67.5, 112.5),'SE' :(112.5, 157.5),'S' :(157.5, 202.5),'SW' :(202.5, 247.5),'W' :(247.5, 292.5),'NW' :(292.5, 337.5)})
DaFool wrote: Also, it's neat that you were able to cut down the walkcycle to 6 frames. I tried that also and the result wasn't too bad. I started off with frames 1-15 (the 16th frame is the same as frame1) and ideally would cut down to frames 1-7(8th frame same as first), but with an odd number of frames it must not divide evenly when calculating the speed that the animation should slide around.
I'm not sure what you mean 'divide evenly'... there's no requirement to use whole numbers or clean fractions at any point, so it hardly matters anyway. An 8-frame walkcycle would look a lot smoother - you could fit all the important key positions in - so hopefully you shouldn't have any trouble fitting it in; I went with six 'cause I'd animated it before and because I didn't want to spend too long on it when I could be doing more-useful coding.

(You've probably seen it before, but here's a pretty good walkcycle tutorial with an eight-frame basis:
http://www.idleworm.com/how/anm/02w/walk1.shtml
If you're really interested in animating by hand, I'd also recommend "The Animator's Survival Kit":
http://www.amazon.co.uk/Animators-Survi ... 977&sr=8-2 )
DaFool wrote: W and S can flip to each other (provided that the pose is symmetrical) and N and E can flip to each other as well, so one only needs to animate two walkcycles
Indeed. Well, in non-iso you can still flip N/S for a starting point, it's just that you need to draw over it all still. But realistically, this only helps with animation 'cause once you start shading, even before giving the guys weapons or whatever, it's going to start looking odd.
jack_norton wrote:Once you add hex-grid and renpy 6.11 support (once reaches stable build) I'll be really interested in using it :)
Both of those things are definitely on my to-do list! Realistically, it runs fine under 6.11 already, it's just that there are some things that I could do witih 6.11 - like panning - which I've not implemented specifically because 6.11 doesn't seem stable enough to require it yet.

Hex grids are a little more tricky, I've got to figure out how best to do the algorithm to find LoS for a hex grid, and I'd also like to re-do the LoS and pathfinding and so on using more of a Visitor approach, so I (and other customisation programmers) can more-easily use the same methods for stuff like radius-effect, target-finding and so on.
Server error: user 'Jake' not found

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4084
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Battle Engine - Alpha 2 release, downloads in first post

#135 Post by jack_norton »

Jake wrote: Hex grids are a little more tricky, I've got to figure out how best to do the algorithm to find LoS for a hex grid, and I'd also like to re-do the LoS and pathfinding and so on using more of a Visitor approach, so I (and other customisation programmers) can more-easily use the same methods for stuff like radius-effect, target-finding and so on.
Yes, I've tried to make a good wargame engine with hexmap (and without LoS, just basic fog of war) but I gave up! Too hard for me, even if playing those wargames seems nothing particularly hard to code :) Will keep an eye on the engine progresses, good luck with it!
follow me on Image Image Image
computer games

Post Reply

Who is online

Users browsing this forum: No registered users