Default map featuredefs

Default map featuredefs

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

Locked
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Default map featuredefs

Post by Forboding Angel »

I know they are hardcoded into the engine, but someone pretty please post them up in an actual usable featuredef? I'm wanting to replace the model used, etc etc.

One for geovents would be nifty too. I want to try out some stuff and see if I can come up with some sweetsauce for everyone to use.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Default map featuredefs

Post by knorke »

Trees (treetype) and geovent are defined here:
https://github.com/spring/spring/blob/d ... r.cpp#L177

the names used there are more or less the same as in http://springrts.com/wiki/Gamedev:FeatureDefs
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Default map featuredefs

Post by FLOZi »

Pretty sure there was already one in Evo? Search forum I am positive it has come up before wrt the trees.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Default map featuredefs

Post by Forboding Angel »

It was a little unclear how to get the defs to actually accept normal models in their place.

Anyway, so here is what I was cooking up. You will need to either have your game calling spring features as a dependency, or include these features in your game/map, but here are all of the spring engine tree types split into individual defs and set up to render nice looking trees (They are all 0ad pines for maximum non-crappy-looking-ness).

http://pastebin.com/N9dReARh

For newbies, just save the file as treedefs.lua, and place it in Features/All Worlds/treedefs.lua (this goes for either map or game).

At the moment they are set to use multiple sizes of 3 different pine trees. You could easily replace these with whatever you like.

Image

Image

It was really easy to do, just a bit unclear as to how to do it. I don't know why no one ever bothered to do it before.

I'm also thinking of some cool things that might be possible with geovents, but more on that later.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Default map featuredefs

Post by knorke »

http://pastebin.com/N9dReARh is bad, not recommded, especially not to newbies.

Those interessted in topic would better look at jK's orginal post from 3 years ago, where for example the loop actually made sense, instead of this copypaste nonsense that has evolved from it.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Default map featuredefs

Post by PicassoCT »

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Default map featuredefs

Post by Forboding Angel »

knorke wrote:http://pastebin.com/N9dReARh is bad, not recommded, especially not to newbies.
Not recommended by you, perhaps. But then again, you aren't an actual gamedev (other than the dabbling), just mainly an ideaguy who happens to know lua.

The purpose of this is to be able to use different models for all 20 of the default tree types. JK's original loop did not account for that and instead used DRAWTYPE.TREE which runs directly counter to the purpose of this.

Even you should be able to figure out that much on your own.

User warned for this post - Felony 1. Play nicely boys.

-- FLOZi
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Default map featuredefs

Post by FLOZi »

But all you change each time is the model, can be done much better:

Code: Select all

local models = {"ad0_pine_1_xl.s3o", "ad0_pine_1_l.s3o" ...}
for i=0,20 do
  CreateTreeDef(i)
  treeDefs["treetype" .. i].object = "features/0ad/" .. models[i]
end
:-)

Personally I would create a new dir with only the models I wanted and rename the files e.g. treetype1.s3o etc and then use VFS.DirList to automatically assign. But if you are attached to all features being in SpringFeatures I can understand why you wouldn't want to go that way for evo.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Default map featuredefs

Post by knorke »

Forboding Angel wrote:
knorke wrote:http://pastebin.com/N9dReARh is bad, not recommded, especially not to newbies.
Not recommended by you, perhaps. But then again, you aren't an actual gamedev (other than the dabbling), just mainly an ideaguy who happens to know lua.

The purpose of this is to be able to use different models for all 20 of the default tree types. JK's original loop did not account for that and instead used DRAWTYPE.TREE which runs directly counter to the purpose of this.

Even you should be able to figure out that much on your own.
lol

User warned for this post - Felony 2. Play nicely boys.

-- FLOZi
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Default map featuredefs

Post by knorke »

What else but "lol" could be the answer to all that?

Does it really need explaining why

Code: Select all

for i=0,20 do
  CreateTreeDef(i)
end
callingCreateTreeDef() 20 times makes no sense if CreateTreeDef() contains all 20 defs anyway?
I think just pointing out that something is wrong with loop should be enough to see that, well if one bothers to look...But 500 same copypasted lines is really hard to overlook? And then tell newbies to use that..

Or that anyone can actually click that link and see that the original did use models and not "DRAWTYPE.TREE" as claimed?

Or why moderation ignores posts with personal attacks and non sense, until they are answered on?
Sadly making up non sense is way quicker than debunking it, so not every time it is worth the effort to write a detailed answer, link sources etc. However it would also be bad to just leave the non sense unanswered because then people start to believe it..

Or how useless it is to work on wiki or think out forum replies if some "actual" game developers will just contradict everything anyway? There is way too much respect for silly "titles" and nobody seems to care what is actually posted.

Thus to all the above the only answer is "lol".
Also acceptable might have been: "wat".
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Default map featuredefs

Post by Jools »

Forboding Angel wrote: But then again, you aren't an actual gamedev (other than the dabbling), just mainly an ideaguy who happens to know lua.
Actually knorke is:
Owner
Occasional game devlopment assistant
Reserve repo admin
For xta as nominated by dnw.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Default map featuredefs

Post by Forboding Angel »

And yet, you assume that said user wants exactly the same stats for each feature.

Lol, k jools. Whatever you say.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Default map featuredefs

Post by knorke »

1) lol.
2) The loop is still nonsense.
3) A few different stats per feature does not mean that one has to copypaste hundreds of identical lines.
4)This is a Lua problem. Do you even? No. So why discuss it.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Default map featuredefs

Post by smoth »

It is possible that you can establish a table that is built in a way that each element in the table can have differing stats forb.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Default map featuredefs

Post by Forboding Angel »

Yet, no one has ever bothered to actually do it.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Default map featuredefs

Post by knorke »

Forboding Angel wrote:Yet, no one has ever bothered to actually do it.
How can you insist that no one has ever done that when your copypastebin is edit of a post which did excactly this.
In this thread Flozi posted a way again.
You do not "see" that denn es fehlt Basiswissen.
What it comes down to is creating tables and changing some entries: Read http://lua-users.org/wiki/TablesTutorial
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Default map featuredefs

Post by Forboding Angel »

Forboding Angel wrote:Yet, no one has ever bothered to actually do it.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Default map featuredefs

Post by smoth »

No reason. I could if you need me to but I don't think it is necessary. Unlike others I don't think that it needs it and all. Dunno, not a big deal was just trying to say it is doable
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Default map featuredefs

Post by FLOZi »

knorke wrote:What else but "lol" could be the answer to all that?

Does it really need explaining why

Code: Select all

for i=0,20 do
  CreateTreeDef(i)
end
callingCreateTreeDef() 20 times makes no sense if CreateTreeDef() contains all 20 defs anyway?
I think just pointing out that something is wrong with loop should be enough to see that, well if one bothers to look...But 500 same copypasted lines is really hard to overlook? And then tell newbies to use that..

Or that anyone can actually click that link and see that the original did use models and not "DRAWTYPE.TREE" as claimed?

Or why moderation ignores posts with personal attacks and non sense, until they are answered on?
Sadly making up non sense is way quicker than debunking it, so not every time it is worth the effort to write a detailed answer, link sources etc. However it would also be bad to just leave the non sense unanswered because then people start to believe it..

Or how useless it is to work on wiki or think out forum replies if some "actual" game developers will just contradict everything anyway? There is way too much respect for silly "titles" and nobody seems to care what is actually posted.

Thus to all the above the only answer is "lol".
Also acceptable might have been: "wat".
This post in and of itself is a better response than 'lol'.

As for 'why moderation ignores...', we are not omnipresent.

Image
Locked

Return to “Map Creation”