How we might achieve all tilesets at once ..

For code related discussions and questions
User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

How we might achieve all tilesets at once ..

Post by Goth Zagog-Thou » 07 May 2012, 07:43

I've gotten into the habit of eyeballing the source code from time to time (Master versions, of course). I'd like to start a discussion about how we could possibly do that whilst maintaining compatibility with current-style maps.

I see that in /src/map.h (line 34 onward) that we enum TYPE_OF_TERRAIN as follows:

Code: Select all

/* The different types of terrain as far as the game is concerned */
enum TYPE_OF_TERRAIN
{
	TER_SAND,
	TER_SANDYBRUSH,
	TER_BAKEDEARTH,
	TER_GREENMUD,
	TER_REDBRUSH,
	TER_PINKROCK,
	TER_ROAD,
	TER_WATER,
	TER_CLIFFFACE,
	TER_RUBBLE,
	TER_SHEETICE,
	TER_SLUSH,

	TER_MAX,
};
and #define our three tilesets immediately after that.

What if we were to prefix those and differentiate them into three groups to read:

Code: Select all

/* The different types of terrain as far as the game is concerned */
enum TYPE_OF_TERRAIN
{
	TER_AR_SAND,
	TER_AR_SANDYBRUSH,
	TER_AR_BAKEDEARTH,
	TER_AR_GREENMUD,
	TER_AR_REDBRUSH,
	TER_AR_PINKROCK,
	TER_AR_ROAD,
	TER_AR_WATER,
	TER_AR_CLIFFFACE,
	TER_AR_RUBBLE,
	TER_AR_SHEETICE,
	TER_AR_SLUSH,
        TER_UR_SAND,
	TER_UR_SANDYBRUSH,
	TER_UR_BAKEDEARTH,
	TER_UR_GREENMUD,
	TER_UR_REDBRUSH,
	TER_UR_PINKROCK,
	TER_UR_ROAD,
	TER_UR_WATER,
	TER_UR_CLIFFFACE,
	TER_UR_RUBBLE,
	TER_UR_SHEETICE,
	TER_UR_SLUSH,
        TER_RM_SAND,
	TER_RM_SANDYBRUSH,
	TER_RM_BAKEDEARTH,
	TER_RM_GREENMUD,
	TER_RM_REDBRUSH,
	TER_RM_PINKROCK,
	TER_RM_ROAD,
	TER_RM_WATER,
	TER_RM_CLIFFFACE,
	TER_RM_RUBBLE,
	TER_RM_SHEETICE,
	TER_RM_SLUSH,
	TER_MAX,
}; 
And then have the engine grab the needed tile for that type? Or would this be a little bit *too* vague?

Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3777
Joined: 03 Aug 2006, 19:39

Re: How we might achieve all tilesets at once ..

Post by Per » 07 May 2012, 08:03

Why do you want all tilesets at the same time? They represent different geographic locations that were not meant to blend.

User avatar
Berg
Regular
Regular
Posts: 2204
Joined: 02 Sep 2007, 23:25
Location: Australia

Re: How we might achieve all tilesets at once ..

Post by Berg » 07 May 2012, 10:53

If you want to change the look of the terrain make a new tile set..
A island tile set would be nice palm trees and hula girls etc.

User avatar
Shadow Wolf TJC
Regular
Regular
Posts: 1047
Joined: 16 Apr 2011, 05:12
Location: Raleigh, NC

Re: How we might achieve all tilesets at once ..

Post by Shadow Wolf TJC » 07 May 2012, 12:41

Per wrote:Why do you want all tilesets at the same time? They represent different geographic locations that were not meant to blend.
Parts of some tilesets could, in theory, coexist in real-life. This is especially true with the Urban tileset, which could be set geographically anywhere, wet or dry, cool or warm, though there could also be, say, a cool dry desert, a tundra, where mountains have icecaps like in the Rockies tileset, while the ground below is barren like in the Arizona tileset, or a tropical setting, where it mixes the green grass found in the Rockies tileset with the sandy textures from the Arizona tileset.
Creator of Warzone 2100: Contingency!
Founder of Wikizone 2100: http://wikizone2100.wikia.com/wiki/Wikizone_2100

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: How we might achieve all tilesets at once ..

Post by NoQ » 07 May 2012, 16:01

Per wrote:Why do you want all tilesets at the same time?
To make amazing maps! :D

User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: How we might achieve all tilesets at once ..

Post by Goth Zagog-Thou » 07 May 2012, 21:08

ShadowWolf and NoQ hit it on the head. It's to make amazing maps and because the tiles can all work interchangeably. Snowy Desert, for example. Grey meets Red (like the geography one would see in Utah and Montana). Things like that. :D

User avatar
Rman Virgil
Professional
Professional
Posts: 3812
Joined: 25 Sep 2006, 01:06
Location: USA

Re: How we might achieve all tilesets at once ..

Post by Rman Virgil » 08 May 2012, 01:53

.

It's also the next logical step on the heels of the already implemented universal map feature set. :3
.
.

Impact = C x (R + E + A + T + E)

Contrast
Reach
Exposure
Articulation
Trust
Echo
.

User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: How we might achieve all tilesets at once ..

Post by Goth Zagog-Thou » 08 May 2012, 02:33

And it would make converting FlaME over to the 3.1+ way of doing terrain that much easier, when that time comes.

User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: How we might achieve all tilesets at once ..

Post by vexed » 08 May 2012, 03:55

Goth Zagog-Thou wrote:I've gotten into the habit of eyeballing the source code from time to time (Master versions, of course). I'd like to start a discussion about how we could possibly do that whilst maintaining compatibility with current-style maps.
...

Code: Select all

/* The different types of terrain as far as the game is concerned */
enum TYPE_OF_TERRAIN
{[snip]
	TER_AR_WATER,
	TER_UR_WATER,
	TER_RM_WATER,

}; 
And then have the engine grab the needed tile for that type? Or would this be a little bit *too* vague?
Why would water/rubble/whatever behave any differently in urban than it does in arizona or ... ?

All you need to do is load up the textures, then fix the corresponding files that look up said texture.
Look in data\base\tileset.
Yeah, that is using the "decals" way like in 2.X... if you want to handle all textures via code on the new system, you need to fix the code and how maps are made with flame...

BTW, the resource system in WZ is ... not very smart, so, if someone was going to load all possible textures, it is possible to run out of texture memory on some machines.
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: How we might achieve all tilesets at once ..

Post by NoQ » 08 May 2012, 05:48

So it's necessary to make the resource systems smart and load only the textures that are actually used on a particular map ... >.<

User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: How we might achieve all tilesets at once ..

Post by Goth Zagog-Thou » 08 May 2012, 05:52

Well, for water it shouldn't be necessary, but perhaps in the future someone might want lava (which can be treated like water, at least until hover propulsion units go over it, in which case it could be scripted that they take damage).

Thinking outside the box -- and thinking ahead so that the new terrain system could have the flexibility to handle things like lava and whatnot.

Never hurts to discuss. :)

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: How we might achieve all tilesets at once ..

Post by NoQ » 08 May 2012, 06:59

Probably a color adjustment for textures (and water) could be cool too ...

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: How we might achieve all tilesets at once ..

Post by NoQ » 09 May 2012, 06:02

Emm guys i just realized something. I think we already have everything we need to make multi-tileset maps as map-mods, without changing a single line of code, substituting png files or tripling memory usage.

All we need is to understand how Mysteryem's sandmod works. It modifies wrf files to inject another png file into vram and modifies some other file to assign it to a certain tile class. I think we can attach existing png files to tilesets in a similar way.

I'll try to come up with a proof of concept map-mod when i have time.

User avatar
Goth Zagog-Thou
Regular
Regular
Posts: 1582
Joined: 06 Jan 2007, 08:08
Location: Delta Base
Contact:

Re: How we might achieve all tilesets at once ..

Post by Goth Zagog-Thou » 09 May 2012, 06:54

Oh hot damn! That's one of the reasons why I love this community so much -- we REALLY are thinkers. :)

I await that with baited breath, NoQ. Outstanding! /cheer

User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: How we might achieve all tilesets at once ..

Post by NoQ » 09 May 2012, 07:32

One thing i forgot to mention is that it won't work on decals. But decals aren't too large to include when necessary.

It also might work on water (including some weird things like making the water cracky or fluffy etc.)

Post Reply