A handful of questions

A handful of questions

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

Post Reply
Tiel
Posts: 4
Joined: 19 May 2013, 22:39

A handful of questions

Post by Tiel »

Wasn't sure where to put a thread of this nature since the 'Help' section seems to consist of bugs and 'Game Development' has more to do with mechanics than inquiries.

Anyway, hi, name's Tiel. I first ran across Spring back in the summer of 2009, and while I've tried it throughout the years since then, it's only now I'm making a serious attempt at figuring this all out.

So, I've got a single unit ingame with teamcolors by following the plethora of tutorials available (doesn't fire and they actively try to bludgeon each other to death when moving in groups, but hey, progress). The game I'm making is science fiction and set in space. I already have all the models and textures for them (or soon will, it's something of a collaborative project by a community) so I'm pretty well set, save for these few questions.

1) Capturing things: It seems like this is a default function within Spring, but I haven't got anywhere on searching. Basically, would like to have buildings (planets, actually) neutral at game start that are able to be appropriated by sending a unit to garrison it.

The difficult part is that I'd like to have said unit remain 'inside' the building as a statistic, like Starcraft's bunkers except incapable of firing out, and that the enemy faction can send their own units to 'garrison' it, upon which the forces there fight, somehow, until one comes out the victor and either seizes or retains control of the building.

I guess one way the latter could be simplified is by just teleporting the units inside the building and just standby until either called out or an enemy unit is similarly garrisoned, whereon they'll actually fight. Can the Spring engine keep track of that kind of thing and swap control over to the invading force should they succeed? This is supposed to represent the two armies fighting on the planet's surface.

2) Space: The game's basic design could, in a nutshell, be described as "a poor man's Sins". I've already looked around and found that making the skybox that of space and using some form of 'void' tag on the map's definition (allowing transparency) would suffice to create this effect, though there are some complications.

The first would be that the idea here is to have...well, easier to have a picture.

Image

The black is transparency; unimportant and easily doable. The white circles are gravity wells, which have some opacity within their radii to better represent where they are. These need to be high fidelity and on the map's texture itself, or as part of the planets' models, which are the green balls in the wells.

Several issues are presented by that alone. I've read that Spring doesn't like any sort of alpha channel trickery that isn't a box. That would be negated somewhat by having the wells be part of the planet's model, but understand that units will be moving within these wells. Perhaps put the texture plane for that beneath the actual ground collision they'll be moving on (which shouldn't be a problem since the ground is transparent)?

Lastly, the gray lines represent the mass accelerators tying everything together. A mass accelerator would be a teleporter structure spanning from one gravity well to another, a high visible beam of light crossing the distance between two neutral emitters. I present to you another poorly drawn Paint image.

Image

The idea is you move your units to 'garrison' accelerator A and they then pop up around accelerator B. The light is just there to serve as an indicator to players where the routes are, as they'd be destroyable to potentially isolate a system. They'd be rebuildable, of course, but movement through space from one planet to another in order to establish such a construct would be exponentially slower than utilizing an accelerator.

And that's another point of worry for me. AI. Will they use these teleporters or troll around in dark space? Is there any way to induce them to want to construct an accelerator link? Will they deliberately destroy them on sight for some inexplicable reason? I have no experience with artificial intelligence, so I'm at a loss here.

3) Statistics: Is Spring capable of doing stuff, like, I dunno, having something of an overall 'morale' percentage that's affected by units dying, planets lost, and affects how slow construction is and/or how expensive they are in the first place?

Would it be possible to have something of an exp system where the player ranks up and gains new stuff through the same method, should it exist?

Is it also feasible to, rather than have an infinite pool of resources, have a 'pool', a maximum that the player can reach that can be increased by other factors, sorta like the old C&C games?

4) Missions: I'd like to have a system in which the game sporadically offers assignments to a player like 'patrol x gravity well' and records their success or failure in it and offers rewards appropriately. The exp system, should it be feasible, would heavily factor in it, I'd imagine. Just a way to keep people busy and entertained.

5) GUI: I mean no offense, but Spring's default GUI is pretty clunky. How does one go about changing this and skinning it afterwards?

6) Pathfinding: Oh lawdie. I just wanted to get this out of the way, because after moving my units around in the field and laughing a bit at their stupidity I couldn't find anything to help the fact that a formation of units act like bumpercars.

I read "Forbie's guide to making the pathfinder love you(?)" but it appears all the changes he made are default now, save for heatmapping which doesn't seem to help anything. How do you accomplish stuff like this and this, which are demos for .88 and .86, respectively? Were the devs just cockteasing a feature that was never added, or am I just doing something horrendously wrong?

I think that's about it. Thank you for any help and I apologize if I come off as demanding. My project's pretty much hit a standstill until I can get assistance with this stuff.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: A handful of questions

Post by Beherith »

Welcome to Spring!

2. Doable, the transparency bit is doable, but it needs to be done in Lua (the gravity well)
http://springrts.com/phpbb/viewtopic.ph ... 06#p531306
The logic is doable in Lua.

3. Also doable in Lua
4. ZK has something like this.
5. Chili framework looks great and is customizable
6. use ctrl+move :)
Tiel
Posts: 4
Joined: 19 May 2013, 22:39

Re: A handful of questions

Post by Tiel »

Thank you, but as far as the ctrl+move, that does help somewhat but they still insist on ramming into one another en route. User friendliness is also a big plus, any idea how to use http://springrts.com/phpbb/viewtopic.ph ... 3&start=20? It gets an error upon starting.

I'll look at Chili's tuts.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: A handful of questions

Post by knorke »

1) yes, there is capture function in engine.
Basically a builder with canCapture=true can capture any units which have capturable = true
http://springrts.com/wiki/Units-UnitDefs
But Lua can also change ownership of a unit, so you can invent your own capture mechanism.

Bunkers can work like you described.

2) Is the map you want basically still a normal 2d heightmap, kind of like a map with many islands that a linked by landbridges? Similiar to say, this map:
Image
And the gravity well/planets models is just graphic details? You can not only put textures on the map but also draw things with gl:
http://springrts.com/phpbb/viewtopic.ph ... 20#p541605 (see complete thread)
The idea is you move your units to 'garrison' accelerator A and they then pop up around accelerator B.
Teleports have been done. There are functions to read&set a units position.
And that's another point of worry for me. AI. Will they use these teleporters or troll around in dark space? Is there any way to induce them to want to construct an accelerator link? Will they deliberately destroy them on sight for some inexplicable reason? I have no experience with artificial intelligence, so I'm at a loss here.
No, the AIs will not understand such new gameplay stuff on their own. The logic to use them must be programmed into them or a completly new AI must be writen.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: A handful of questions

Post by Google_Frog »

This all sounds doable. With Spring you can write gadgets to implement a wide range of game mechanics. They have callins for many events (eg, unit destroyed or unit damaged) and can read everything about the gamestate. They can do most basic actions such as create or destroy units.

1) Gadgets can transfer unit control. Don't use the engine implemented capture command, it is a trap. You could teleport units somewhere or you could destroy them and calculate the result of a battle on the planet.

2) Units can be repositioned and you can draw things on the map. You could even make the move command use teleporters.

3&4) Both easily implemented with gadgets.

5) You can also arbitrarily draw on the UI with things called Widgets. See Zero-K for an example the Chili UI system used to redo the UI.

6) I don't think pathfinding in Spring 94.1 is that bad. But it should not be a worry for you because your units are in space. Usually space units use the gunship movetype which allows them to display each other vertically and push each other away. There are no pathfinding problems with gunships.
Tiel
Posts: 4
Joined: 19 May 2013, 22:39

Re: A handful of questions

Post by Tiel »

knorke wrote:1) yes, there is capture function in engine.
Basically a builder with canCapture=true can capture any units which have capturable = true
http://springrts.com/wiki/Units-UnitDefs
But Lua can also change ownership of a unit, so you can invent your own capture mechanism.

Bunkers can work like you described.
Okay, so simple send unit---> capture building would work with minimal effort, but having a simulated struggle between units within would involve scripting? Thanks for the clarification.
knorke wrote:2) Is the map you want basically still a normal 2d heightmap, kind of like a map with many islands that a linked by landbridges? Similiar to say, this map:
Image
And the gravity well/planets models is just graphic details? You can not only put textures on the map but also draw things with gl:
http://springrts.com/phpbb/viewtopic.ph ... 20#p541605 (see complete thread)
Well, I'd figured the heightmap would just be 2d and entirely transparent. I believe the main problem lies with representing something like

Image

the circles around the planets representing the wells. Planets are buildings, units are spaceships, 'gates' are just really, really long structures that take a unit in one end and spit them out the other.

The thread says: "Is a textured rectangle drawn with lua. So you could use transparent maptexture to make a hole in the map and then texture that hole with lua."

Could you elaborate as to how this'd work please?
knorke wrote:
The idea is you move your units to 'garrison' accelerator A and they then pop up around accelerator B.
Teleports have been done. There are functions to read&set a units position.
And that's another point of worry for me. AI. Will they use these teleporters or troll around in dark space? Is there any way to induce them to want to construct an accelerator link? Will they deliberately destroy them on sight for some inexplicable reason? I have no experience with artificial intelligence, so I'm at a loss here.
No, the AIs will not understand such new gameplay stuff on their own. The logic to use them must be programmed into them or a completly new AI must be writen.
Image

Guess I'll just have to make some invisible terrain to funnel ships into the desired lanes, if that's even possible. Thanks for the information.

By the way, where'd your avatar come from? I could've sworn I've seen the image before.
Google_Frog wrote:1) Gadgets can transfer unit control. Don't use the engine implemented capture command, it is a trap. You could teleport units somewhere or you could destroy them and calculate the result of a battle on the planet.

2) Units can be repositioned and you can draw things on the map. You could even make the move command use teleporters.

3&4) Both easily implemented with gadgets.

5) You can also arbitrarily draw on the UI with things called Widgets. See Zero-K for an example the Chili UI system used to redo the UI.

6) I don't think pathfinding in Spring 94.1 is that bad. But it should not be a worry for you because your units are in space. Usually space units use the gunship movetype which allows them to display each other vertically and push each other away. There are no pathfinding problems with gunships.
Ooo, didn't know about the gunship; I'd been using the default Bot movetype. I dunno about capturing, at the moment it does appear lucrative to teleport units and decide ground battles that way, but it'd also be a much easier matter to just use the default capture function and make it so that nothing less than overwhelming force can change the building's owner. Something to think about, I guess. Will also have to look at how Zero-K does their GUI. Thank you for the help.
Google_Frog
Moderator
Posts: 2464
Joined: 12 Oct 2007, 09:24

Re: A handful of questions

Post by Google_Frog »

Tiel wrote:
knorke wrote:No, the AIs will not understand such new gameplay stuff on their own. The logic to use them must be programmed into them or a completly new AI must be writen.
Guess I'll just have to make some invisible terrain to funnel ships into the desired lanes, if that's even possible. Thanks for the information.
There is no AI which will play your game. Spring is so flexible that AIs cannot be directly ported between games. If you were to try and port some AI it would not be as simple as telling it which units to build. You have to tell it how to interact with the game mechanics which are not in Spring by default. For example AIs from elsewhere do not know about garrisoning planets to capture them.

To do what you want you will have to write scripts with Lua. The flexibility of Spring comes from the ability to write arbitrary Lua scripts which can interact with most aspects of a game. There is no way out of this. Luckily it is very easy to write Lua scripts for the things you require.

I have to emphasize this; To get anything done you have to do things which involve scripting.

Specifically:
  • The default capture command is hopeless for what you want to do. There is a single function you can put in a script which tells Spring to give control of a unit to a certain team.
  • Teleportation can be implemented such that units automatically use teleporters. You do not need terrain funnels.
  • Don't worry about skirmish AI at this point. Once you have some Lua experience it is easy enough to create a simple AI which can use all the mechanics of your game. Alternatively you could look into modifying some other AI such that it can use your mechanics.
Tiel
Posts: 4
Joined: 19 May 2013, 22:39

Re: A handful of questions

Post by Tiel »

Is Lua one of those things you can 'learn on the way', or would it be a good idea to take a course online or elsewhere to get familiar with the concepts?
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: A handful of questions

Post by FLOZi »

You can pretty much learn it on the way.

IMO Spring is well suited to what you want. Have you tried the game 'THIS'? Probably the most successful Spring space RTS.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: A handful of questions

Post by Silentwings »

Yeah, you can learn lua very easily. What's harder is dealing with Springs API - for that you'll need to combine asking people, the spring lua wiki and grep searching through previously written widgets/gadgets to find examples.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: A handful of questions

Post by CarRepairer »

Best to login to the lobby and join the moddev channel.
User avatar
Zealot
Posts: 94
Joined: 03 Dec 2012, 13:53

Re: A handful of questions

Post by Zealot »

Sound's like a really cool project.
User avatar
The Yak
Posts: 351
Joined: 20 May 2012, 05:36

Re: A handful of questions

Post by The Yak »

For more info transparent terrain try this thread here: http://springrts.com/phpbb/viewtopic.php?f=13&t=30332
Post Reply

Return to “General Discussion”