The feasability of Spring as a battle engine in a wider game

The feasability of Spring as a battle engine in a wider game

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
NeOmega
Posts: 63
Joined: 15 Dec 2010, 11:06

The feasability of Spring as a battle engine in a wider game

Post by NeOmega »

What is the feasibility of use spring to play out battles determined by a 2d turn based map? In other words, the 2d map would send what units are fighting, those units would be spawned in a spring battle, the battle plays out, and then the results sent back to a 2d game. (no factories or energy or metal).

It's been over a decade since I did a massive project, but I really have the itch. I am looking at either modding mount and blade, or using spring as the battle engine to determine outcomes from a turn based 2d game.

I haven't played much mount and blade at all. It has a gui mod system, and I still might go with it, but right now, I am finding out it would take me hundreds of hours to learn the game well enough to mod it. This one I already basically understand.
hokomoko
Spring Developer
Posts: 592
Joined: 02 Jun 2014, 00:46

Re: The feasability of Spring as a battle engine in a wider game

Post by hokomoko »

Extremely feasible, and already done to some effect in ZK planet wars.
In the game script you can add custom fields - gadgets can then read them and spawn what units are necessary.
gajop
Moderator
Posts: 3047
Joined: 05 Aug 2009, 20:42

Re: The feasability of Spring as a battle engine in a wider game

Post by gajop »

I think most of your work would be to integrate Spring with the "2d map" module of the game.
You could even... make the entire game in Spring. Have the "2d map" act as a LuaMenu (or normal Spring game if you want Spring MP support), and just draw it yourself with some OpenGL (not sure how complex you're imagining it but a simple rectangular grid would be fairly easy to do).
User avatar
Silentwings
Moderator
Posts: 3695
Joined: 25 Oct 2008, 00:23

Re: The feasability of Spring as a battle engine in a wider game

Post by Silentwings »

It's been over a decade since I did a massive project
Can we haz link?
NeOmega
Posts: 63
Joined: 15 Dec 2010, 11:06

Re: The feasability of Spring as a battle engine in a wider game

Post by NeOmega »

Link to my old civ III conversion:
https://forums.civfanatics.com/threads/ ... ts.102263/

Some of the graphics links still work.
NeOmega
Posts: 63
Joined: 15 Dec 2010, 11:06

Re: The feasability of Spring as a battle engine in a wider game

Post by NeOmega »

gajop wrote:I think most of your work would be to integrate Spring with the "2d map" module of the game.
You could even... make the entire game in Spring. Have the "2d map" act as a LuaMenu (or normal Spring game if you want Spring MP support), and just draw it yourself with some OpenGL (not sure how complex you're imagining it but a simple rectangular grid would be fairly easy to do).
i suppose it would be easier to make the entire game in spring, although it looks like you can tell lua to look anywhere for data.

so basically i imagine something as such:

a tbs, tiled map. i think it would have to be tiled, because the battlemap would be determined by the tile. when one army moves onto the tile of another, lua loads the map associated with the tile, the game type, and then, (for now), calls the various units, as well as any potential battle summons, gaian units, and corpses. the battle then commences. the initial spring battle game would be complete annihilation of the other side, although later i plan to make it complete annihilation or 16 minutes, whichever happens first. once the battle has finished, lua writes out to a battle recap file, that the tbs calls to determine what is left on the map, xp and loot gained, etc. in later complexity, after 16 minutes, it stops, writes a battle file, noting the position, morale, etc of all units and corpses, so the battle can recommence, with the possibility of reinforcements from the tbs, with the next turn.



tl:dr it was suggested i could make the tbs run in opengl, but i am expecting far more complexity in the tbs than the rts. would it be possible to run a complex, strategic instance of spring, have it write data for battle, pause, have the tactical instance pick it up, run the battle, then write the outcome files, which then get called by the strategic instance of spring... ...without it lagging terribly/breaking down?

my guess is kind of, but definitely yes, if that which can not be mentioned is mentioned. (rhymes with empty).

btw, just want to say, yes, i am aware of what i am getting into, thats why i want to make sure i do not spend months of developement only to find a dead end, although i love workarounds etc. also, this game has been brewing for 9 years at least. I have finally come to the conclusion i must do this, or i will never be happy. i have thrown away hundreds of concepts and ideas. the entire structure/outlay/story/concept of this game is going to be like nothing ever seen before. and most importantly, it will be fun.
gajop
Moderator
Posts: 3047
Joined: 05 Aug 2009, 20:42

Re: The feasability of Spring as a battle engine in a wider game

Post by gajop »

tl:dr it was suggested i could make the tbs run in opengl, but i am expecting far more complexity in the tbs than the rts. would it be possible to run a complex, strategic instance of spring, have it write data for battle, pause, have the tactical instance pick it up, run the battle, then write the outcome files, which then get called by the strategic instance of spring... ...without it lagging terribly/breaking down?
Sorry, I'm not 100% sure what you're saying here.
Are you suggesting you should run two instances of Spring (strategic and tactical)? I don't think that's such a great idea, you might as well use some other engine for the strategic (TBS) element then.

I mentioned LuaMenu, which would allow you to keep it all in one instance (one window), so it felt more integrated. I think it would kinda suck if your game was opening other windows to do the real time simulation, therefore I suggested to try using LuaMenu so you could integrate both the strategic and real time elements in one program.

I'm not sure if you plan for multiplayer, and that might be more difficult, but I suppose that could be considered, although it would require some engine changes to achieve. (Maybe you'd need something like LuaMenu, but with networking).
NeOmega
Posts: 63
Joined: 15 Dec 2010, 11:06

Re: The feasibility of Spring as a battle engine in a wider game

Post by NeOmega »

That's the answer I was looking for. It's pretty concrete and what I expected.
Basically, a graphically light TBS (2d), crunching the CPU between turns, using spring as battle engine.

I do plan for multiplayer, but different then what Spring is really set up for, (probably not pitched battles between players), and definitely not traditional tbs strategy multiplayer, as that is, and always will be, a fail. The reason I intend to stick with spring is I spent 3000 hours playing BA, so when I finally looked into the lua understructure, I realized I understood what was going on pretty good. This was just last week. And Ive been terrified of coding since college. But I'm not anymore. I already love lua. Multiplayer would be more like an explore/attack other players cities, fortresses, etc. More often than not, these places will have been abandoned long ago by the player, but they will continue through a build-to-order quick simulation. In other words, you pick the map tile, attack, the fortress or city or whatever goes out of sleep mode and runs a very quick "where is it now" kind of routine, based upon how long since it was last visited or played. It wouldn't actually simulate every single turn or hour since, it would just use a broad based "lets say this player was playing the whole time, farming (as in the lame thing people end up doing in MMO's, so why not just embrace it, and make it so everybody farms, always?), what would they have by now?"

Pitched battles etc would be cool between players, and perhaps there could be some kind of arena/gate system, but that would require strong demand from the "single player" base, before I'd consider trying to implement it.

Or it may be an open world single player a la mount and blade. I really liked the way they handled time in that. In other words, a slow RTS sandbox.
Google_Frog
Moderator
Posts: 2451
Joined: 12 Oct 2007, 09:24

Re: The feasability of Spring as a battle engine in a wider game

Post by Google_Frog »

NeOmega I feel like you would benefit from giving the Zero-K campaign a look (just run this http://zero-k.info/Wiki/Download). This is what gajop means when they say "use LuaMenu". The Zero-K campaign runs in a single instance of Spring and has a mission selection screen (or strategic map) from which the player launches the individual missions. Technically the content of the missions are able to be entirely determined by the strategic map and any TBS could be run in the strategic map screen. The fairly static strategic map and limitations on what can be changed in the mission are just design decisions. If you want to write a singleplayer TBS without fancy graphics then I would use the same system.

If you want to use some more Spring features for your strategic map (3d models and terrain, user interface etc..) then I would suggest you use an invisible LuaMenu that loads players into the strategic map between tactical battles. This is technically quite similar to the Zero-K campaign method, the difference between the two is whether you write your own graphics and UI in a gameless LuaMenu or whether you use a Spring game for your graphics and UI. In both cases LuaMenu would be used to store the strategic game state and to load the games.

For a multiplayer TBS I think you will be writing your own networking code for the strategic map. Planetwars is the closest thing that has been done. It runs on the Zero-K server and players can interact with it through lobby UI and a webpage. The lobby server is able to tell people to run tactical battles.
gajop
Moderator
Posts: 3047
Joined: 05 Aug 2009, 20:42

Re: The feasability of Spring as a battle engine in a wider game

Post by gajop »

For a multiplayer TBS I think you will be writing your own networking code for the strategic map.
I second most of what GF says, but I recommend you don't rush to make your own custom networking yet.
It might be possible to do networking using Spring, although it would require considerable engine changes. Still, I think TBS games can definitely be implemented using a synced engine, so changing Spring to support that *might* be viable, depending on the interest of engine devs. But hey hokomoko sat down and implemented LuaMenu in a pretty short amount of time, which I didn't think it was possible, so this *might* be possible too.

TLDR: Don't design your networking/MP yet. Do it later on, when you already have something to show for.
NeOmega
Posts: 63
Joined: 15 Dec 2010, 11:06

Re: The feasability of Spring as a battle engine in a wider game

Post by NeOmega »

i have no intention of doing tbs mp. it never works anyway. if i did, it would be more like spore, where you download another players sandbox, and run around in it.
Post Reply

Return to “Game Development”