the heightmap exporter is here!

the heightmap exporter is here!

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

user
Posts: 452
Joined: 22 Jan 2008, 16:33

the heightmap exporter is here!

Post by user »

remember that old heightmap exporter made by the fat controller?

i didn't work.

i fixed it, now it works, exports heightmaps correctly.

it comes with the image magick image converter, which should be used to convert the exporter output to png.

don't forget to vote in me on the widget of the month topic.

here is the readme, since some people don't waste time reading it,
read it before using:

Code: Select all

the ultimate heightmap stealing device readme:

comes with examples, feel free to remake them.  

usage:

place the lua file on your luaui/widgets directory, place the output directory on luaui/widgets too.

/luaui exportheightmapppm   

use it to export the heightmap.
execute the batch file on the output folder after exporting.

/luaui exportheightmapbmp

does not work, exports it to something very bad.

/luaui exportheightmaptga

i have the format there, but i haven't finished it.

/luaui exportheightmaptxt

i have made it for testing, but not removed it, it is useless. 

/luaui exportslopemaptxt

prototype for exporting slope maps, haven't finished the true slope map exporter. 

what i expect to see:

that super old ai is obsolete, it will be forgotten for ever.
more maps, people will be able to remake other people maps at anytime now.
i hope to see this in mods too.

credits: pgm image format, image magick, and me.    

have fun exporting heightmaps.  

if any problems then contact user
here is it:

http://www.darkstars.co.uk/downloads/vi ... xporter.7z

any problems post here.

and don't forget to vote in me.
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

uploaded it, have fun!, i hope to see a lot of new maps soon.

and please vote in me.
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

this is really useful, i have the heightmap of all the maps i have in my maps folder.

and we can now remake old maps, or even remake maps which their source images were lost.

vote on me in this topic.
User avatar
url_00
Posts: 163
Joined: 15 Apr 2007, 22:44

Re: the heightmap exporter is here!

Post by url_00 »

Wait... I'm confused.
Does this export the map's height map, or the current state of the height map?
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

the current state, so you can "model" a heightmap in game using terraforming in some mods like CA or simbase, then export it and use.
User avatar
Otherside
Posts: 2296
Joined: 21 Feb 2006, 14:09

Re: the heightmap exporter is here!

Post by Otherside »

or deform it with nukes and explosions ? then export amrite ?
User avatar
BrainDamage
Lobby Developer
Posts: 1164
Joined: 25 Sep 2006, 13:56

Re: the heightmap exporter is here!

Post by BrainDamage »

user wrote:the current state, so you can "model" a heightmap in game using terraforming in some mods like CA or simbase, then export it and use.
combined with trepan's widget for editing ground texture on the fly, this would make an awesome realtime map editor, just add more brushes type, ecc
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

or deform it with nukes and explosions ? then export amrite ?
yes, use .give 100 armcom, or whatever, a bunch of times, then self-d
them, you can also make negative craters, craters that go up instead of down, by setting negative hardness or crater multiplier.
combined with trepan's widget for editing ground texture on the fly, this would make an awesome realtime map editor, just add more brushes type, ecc


yes it would, but it is not texture editing, it is reading the heightmap using the GPU.

the problem is that saving a big image, like 8192x8192, using lua, would be bad, and the user would have to run a batch file after every export, because lua 5.0 doesn't has the good os functions, needed to run mapconv directly from the game.

another problem, is that ppm images are huge, while a 1024x1024 bmp is 4mb, a ppm is 15mb.

overall it isn't a bad idea, because spring rarely crashes when doing intensive functions.
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

here is a small tutorial on how to edit your height map in game!

1. get SimBase, or CA.
2. open the mod file using 7 zip.
3. edit the lua rule file unit_terraform.lua, the mound, trench, whatever
to what you want, i recommend leaving it as is.
4. edit the unit files, mound, trench, and the others, set the max slope to 66536, or any big number, and footprint to 1.
5. start up a game, can be single player or multi player, against a test global AI dll.
6. type in .cheat.
7. type in .nocost.
8. start building mounds and trenches, where you want.
9. after finished, type in /luaui exportheightmapppm
10. quit spring, go to the output folder(LuaUI\Widgets\output\)and run the batch file found in there.
11. make your map!
12. have fun!

i will later upload a plain map.

extra hints:
1. compile your map without the texture, then make your heightmap in game.
2. making it in multi player can be really fun.
3. make extra brushes for faster editing.

i will finish this later.
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

i am making a "heightmap editor" map with special lua scripts, like brushes, smoothing(will use the same algorithm i used for mapconv smoothing!), and special helper units, which can build the brushes.

another option: trace screen ray, to get ground from mouse coordinates, and draw "circles" to show the brush, and deform, or whatever.

all i have to say is that this will be fun, and that this is not a small project, because such thing has never been done in spring lua, many had thought of this, but haven't done it.
User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: the heightmap exporter is here!

Post by TheFatController »

user wrote:i am making a "heightmap editor" map with special lua scripts, like brushes, smoothing(will use the same algorithm i used for mapconv smoothing!), and special helper units, which can build the brushes.

another option: trace screen ray, to get ground from mouse coordinates, and draw "circles" to show the brush, and deform, or whatever.

all i have to say is that this will be fun, and that this is not a small project, because such thing has never been done in spring lua, many had thought of this, but haven't done it.
Sweet :D

I suppose a brush could do auto gradients from one height to another when you drag a line across 2 points (with variable width), if you set up a special mod with the widget and all the gadget interactivity inside it you could just load the mod with a map and edit it 8)
user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: the heightmap exporter is here!

Post by user »

expect the real work on this start in a bunch of months, i have too many things currently, and i don't like to leave things unfinished, but it isn't a bad idea, since a real map editor program is really harder than this.
kb18951452
Posts: 53
Joined: 03 Oct 2007, 16:20

Re: the heightmap exporter is here!

Post by kb18951452 »

I am trying yo export the bmp exportheightmapbmp and can't seem to get it to work. Anyone mind helping me?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: the heightmap exporter is here!

Post by imbaczek »

bmps aren't very good, they'll be only 8 bits, and most spring maps have 16bit heightmap. i strongly suggest using springmapedit to export a 16bit grayscale RAW.
kb18951452
Posts: 53
Joined: 03 Oct 2007, 16:20

Re: the heightmap exporter is here!

Post by kb18951452 »

how do i open a map in springmapedit?
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: the heightmap exporter is here!

Post by imbaczek »

Map | Load | import spring sm2
kb18951452
Posts: 53
Joined: 03 Oct 2007, 16:20

Re: the heightmap exporter is here!

Post by kb18951452 »

will any old map from spring work like tha, caus ei can't seem to get it to go.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: the heightmap exporter is here!

Post by Beherith »

Seems to me that you have to un 7zip the map files, then load the .smf file in SME
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: the heightmap exporter is here!

Post by zwzsg »

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: the heightmap exporter is here!

Post by AF »

hmmm the file isnt listed anywhere on the filesite =s
Post Reply

Return to “Lua Scripts”