Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Work in Progress / MapMaker - Make high quality maps easily.

Author
Message
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 2nd Nov 2004 13:52
I'm makinga tool that makes high-quality maps from hightmaps and bordermaps easily.

So far, I have implimented:

Greyscaling the heightmap
Creating a quantinized image out of it(with water, grass, and mountains)
Darkining rough terrain(mountains)

I would post a render, but it takes an hour to render a 512x512 image. I learned the hard way when I thought it was 4 minutes, and realized that there was a bug that crashed my code at 11 minutes. At least I fixed a bug and have a good estimate formula. I'll render something tomorow. So far, I've rendered a 32x32 image but it's too lo-res. I've been working on this for several hours, and due to the fact that it's working, I probably won't quit.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Snipa Masta
20
Years of Service
User Offline
Joined: 20th Mar 2004
Location: Bristol,UK
Posted: 3rd Nov 2004 00:17
Screenshots/more info?
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 3rd Nov 2004 01:27 Edited at: 3rd Nov 2004 03:56
(So far, it just renders maps)
Here's a render:

(Could be better)
Post segestions and comments.
I'm aware of the black spot.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Attachments

Login to view attachments
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 3rd Nov 2004 15:38
hmm.. this could be good.

its me n0id!

This is a Map Editor ver 2 DEMO Out now! http://www.tiame.tk
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 4th Nov 2004 00:55
It takes an hour? Why? *-)
You using point() a lot?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 4th Nov 2004 05:24 Edited at: 4th Nov 2004 05:24
Yeah, just realized that in order to render a 1024x1024 bitmap, it takes less than 30 minutes. I've changed my code scince when it took on hour by estimate.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 4th Nov 2004 20:11
Was that a 'yeah' to the fact that you use point() a lot? If you send me the source I can make it use a memblock instead, its sooooo much more faster.

AKA teh great Pet Rat.
Peace sells...but who's buying??
Peter H
20
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 4th Nov 2004 22:12
Lock the pixels with the
command before you use the "point" command and it will speed it up drasticly...

then unlock em with


"We make the worst games in the universe."

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 5th Nov 2004 05:51
Quote: "If you send me the source I can make it use a memblock instead, its sooooo much more faster."

I e-mailed it to you.
I think memblocks would work better than lock/unlock pixels.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Nov 2004 06:02
Memblocks would be EASY to do

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 5th Nov 2004 10:44
Suck at them and never used them before.
My guess is that they contain the resolution and then rgb values per line. Do they? Wouldn't you have to use the read string command a LOT or is there a goto line command? Do memblocks even use file commands?

*Looks at DBP help files*

Is uses byte and not line?!??!
How do I modify bitmaps at per byte(except for-next loops and string= commands)?

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 5th Nov 2004 21:53 Edited at: 5th Nov 2004 21:58
Erm memblocks aren't exactly THAT easy to do but I've used them before and done some cool image stuff with them so I know what to do. There are 3 bytes per pixel in a 24bit image, incase you needed to know that...I'll get to work right away editing your code.

EDIT: Whats HM and BM?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 6th Nov 2004 05:24
Heightmap
and
Bordermap(not used)

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Nov 2004 01:51
Right, just to make sure this works properly, e-mail me a heightmap(zipped or RARed) and a jpeg of what you get when its run through your program. Or just show me the heightmap for the image you posted above.

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 7th Nov 2004 13:52 Edited at: 7th Nov 2004 13:52
Here's the heightmap(download):
Output should be similar to the first output posted.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Nov 2004 20:57 Edited at: 7th Nov 2004 21:44
Right, ok what I've done is I've created functions that are used exactly how point() and DOT are used(but with memblocks instead), except first you need to set up something with another function, but thats easy. I'll just see if I can get the functions working with your code then I'll e-mail you an explanation on how to use the functions(or at least how to set them up).

EDIT: Ok the first part takes about 4 seconds now(how long did it take before?) And the other parts are awfully slow for some reason, but I'm working on it. Also, If I make some more functions I should be able to get everything working a lot faster.

EDIT again: oops I just noticed I am clearing the screen and putting text on it inside the second set of for next loops ...twice. That was only there for testing purposes. It shouldn't be too slow now..

AKA teh great Pet Rat.
Peace sells...but who's buying??
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 7th Nov 2004 22:31 Edited at: 7th Nov 2004 23:45
Is this what it should look like?



The black spots are where the heightmap is too bright..I wonder how it can be fixed. Anyway, provided that the image is what its supposed to look like, it works! Beleive me, its a lot faster now, I'm about to time it to see how long it takes..

23 seconds apparently on a 1024x1024 image, not bad. It sure beats an hour doesnt it though . Well, I'll see how I can optimize it some more..

You see I have two functions for plotting pixels, one accepts an rgb value, while another accepts each value seperatly. In the first function because a single value is passed to it, DBPro has to then find the red green and blue values using rgbr, etc. However, in places where you would use DOT x,y,RGB(blah,blah,blah) rather than using the RGB command, you could just pass the values in the function params alone like:

MEM_dotRGB(x,y,a,a,a)

This saves some processing time, so I'll adapt your code to use it where needed.

EDIT: Well I adapted it and it took the same amount of time O.o. Well it will speed it up some amount, just not a lot. Well its just about done now, I'll send you the code through e-mail along with an explanation on how everything works.

I've sent you the e-mail!

AKA teh great Pet Rat.
Peace sells...but who's buying??
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Nov 2004 01:56
Heh, these functions are cool, I've started making some sort of lightmapper using them. They work very well!



I'm gonna make it make lightmaps using height maps

AKA teh great Pet Rat.
Peace sells...but who's buying??
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Nov 2004 02:12
Quote: "Yeah, just realized that in order to render a 1024x1024 bitmap, it takes less than 30 minutes. I've changed my code scince when it took on hour by estimate."


30 mins?!? I wrote a program that did it in 2 seconds a while ago



Petrat - your lightmapper looks very interesting

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Nov 2004 02:38
Quote: "Petrat - your lightmapper looks very interesting"

Thanks, it is . Well I'm hoping it will be anyway.

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 8th Nov 2004 03:21 Edited at: 8th Nov 2004 03:30
I recived your code, Benjamin.
And I remember a mathimatical rounding function posted in the Newcomer's fourm by Ric(modified version of Mentor's code).

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 8th Nov 2004 03:43 Edited at: 9th Nov 2004 04:53
It took 5 minutes(still better than 20-60). Ric's rounding function greatly reduces time to finish, but doesn't work.

Here's the code for anyone who wants it:


Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Nov 2004 04:57
The rounding function doesn't work? Do you mean it never worked properly? . You still gonna work on this?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ric
20
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 8th Nov 2004 11:18
The rounding code works ....


but NOT when you put it into a function. The reason for that is something complicated and totally over my head. If you want it to work, you need to put it into the main program loop.


Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 8th Nov 2004 22:09 Edited at: 8th Nov 2004 22:11
Quote: "If you want it to work, you need to put it into the main program loop."

A subroutine would do it

@Ilya: Please don't give up on this. This doesn't have to be something you finish straight away, you can work on it over time, adding more stuff to it. Oh and...I would prefer it if you didn't post my memblock functions with your code

AKA teh great Pet Rat.
Peace sells...but who's buying??
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Nov 2004 02:25 Edited at: 9th Nov 2004 04:11
*BUMP*

Also, I think I could probably make your code a lot faster, I've got some ideas..

EDIT: With optimization I managed to get it down to 21 seconds on my machine. What sort of time are you aiming for?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 9th Nov 2004 04:52 Edited at: 9th Nov 2004 04:54
I didn't give up. I have to sleep and go to school.

I'm aiming for any time due to the fact that it renders, and a short time for a draft.

I'll edit my code to not include the functions.

I'll insert the code into a subroutine....

Also, I got Postal2 over the weekend and didn't have time to do anything else.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 9th Nov 2004 05:00 Edited at: 9th Nov 2004 05:06
Subroutine crashes the compiler for some reason(which is bad, because it doesn't compile)...

(Crash on... er woops, included some function commands)

Time has been reduced to 30 seconds, but the output is crap.

Anything wrong with this:

?

And for some reason, shading doesn't appear to change the image.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Nov 2004 05:19 Edited at: 9th Nov 2004 05:20
Quote: " I didn't give up. I have to sleep and go to school."

Oh ok, you just gave the impression you were .

Woah that rounding function does really slow down stuff doesnt it . I remmed out the code in that function and it made the image in 3 seconds(of course, it was completly black because of the rounding function giving no output ).

If you tell me what the rounding function is exactly for and what its meant to do, I can recode it for you if you want.

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 9th Nov 2004 07:18 Edited at: 9th Nov 2004 07:29
The rounding function round a float to an integer(using the numbers after the decimal point). This is so the map has steps. The function is part of the process of deciding what step to be on.

Currently the shading doesn't seem to do anything, by it might with a rougher heightmap.

*sees what int would do instead of the rounding function*

Arg... PC crashed.

Anyway, int causes the same thing as the rounding function, with some errors, in 3 seconds.

*remembers to have an option for this*

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Nov 2004 09:24 Edited at: 9th Nov 2004 09:33
Oh..I thought it did a similar thing to INT, but if the decimal part was higher than .5 then it would get rounded to the above number O.o. I mean ,thats what I thought it would do?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 9th Nov 2004 10:32
Yes, that's what it does.

But it should be more accurate.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Nov 2004 11:15
What do you mean more accurate?

@Final epsilon(if your looking): Hello!

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 9th Nov 2004 11:26
That it rounds all the numbers after the decimal insted of one(or multiple numbers).

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 9th Nov 2004 20:29
Ok now your confusing me O.o

Say the number as 4.39384
What would you want it to end up as?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 9th Nov 2004 20:31
This program looks really good - may I try it? I just wonder what my PC could do (AMD Barton 3200+, 9800XT, 1Gb RAM).

What exactly is the rounding problem? you dont need to round ALL of them....

< .5 round down
>= .5 round up

everythingh else is not needed.. i think..

Nick

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Nov 2004 08:06
Ilya, send him an exe

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 10th Nov 2004 08:59 Edited at: 11th Nov 2004 05:33
Quote: "Say the number as 4.39384
What would you want it to end up as?"


4 and 5. Have 2 functions, one slow and accurate, one fast and nonaccurate.

Quote: "may I try it?"


Probably scince you won't be looking at the memblock functions.
*fixes the code a little*
Nooo... I broke it.
Oh, wait, I know the problem.
Still broke. Re-testing...
Broke.
Fixing...
This error is cheap...
Arg....
.....
Oh.
Testing...
Errr......
Hmmm....
YEZZZZZ.... but the output is crap.
Oh... waterlevel.
Try lowering it...
S***.
S***.
*hits head with glass object*
That hurt more than I thought it would.
Why?!??!?!?!??!
The code worked fine before.
*opens e-mail*
WHAT?!??!?!
I forgot to fill in the correct vars on startup...
Hoping it works now...
Arg... why?!??!
"Cannot load bitmap on line 18, even though it exists, and is valid."
Output... is... still... crap...
And still... "Cannot load bitmap"
And it works with a 256x256 bitmap?!
And a 512x512 bitmap?!
And is crap?!
And i'm editing a temp file?!
........
.....................
...................................
............................................

That's sad.
YESSSSSSSS It works!!!!!!! YEZZZZZZZZZZZ!!!!!!!

P0sd3d.
(Click download)
(And you'll need a HM.bmp file)
Now I can't compress it enough...
Link:
EDIT: Click download and you need 7-zip.
Then click on b1.jar and open it with a zip program.

EDIT: That must've taken at least 2 hours.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 10th Nov 2004 22:15
Quote: "4 and 5. Have 2 functions, one slow and accurate, one fast and nonaccurate."

4 AND 5? But functions can only return one value >_<. Stop confusing me!

AKA teh great Pet Rat.
Peace sells...but who's buying??
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th Nov 2004 02:50 Edited at: 11th Nov 2004 02:51
Two points here:

(1) Cant find a bitmap on line 16 I think it said

(2) Compression.. WHY OH WHY use Winzip.. It sucks goats.. AT LEAST use WinRAR.. Or better (I find for DB EXE's anyway) 7-Zip.. http://www.7-zip.org/

Cheers.. Nick

EDIT: Just read about HM.BMP.. The one up top of this thread ok?

Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Nov 2004 04:16
The one up the top of the thread is the already processed one

AKA teh great Pet Rat.
Peace sells...but who's buying??
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 11th Nov 2004 05:18 Edited at: 11th Nov 2004 05:24
If you have Texture Maker, you should be able to make one. Anyway, here's one(download and it was resized):

You could use any bitmap scince it greyscales it for you.

I know winzip sucks but I didn't think you had anything else.
*Downloading 7zip*

I'm about to post an updated exe and a render.

And I said 4 and 5 because of one function returning 4 and one 5(for speed or proformance).

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 11th Nov 2004 05:36 Edited at: 11th Nov 2004 05:37
Download updated. Go back a page to download the slightly new version.

And here's a render:
http://forum.thegamecreators.com/xt/xt_apollo_download.php?i=433839

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Attachments

Login to view attachments
Oneka
20
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 11th Nov 2004 09:10
so wat does it look like in Advance terrain?


Making better games everday!
Oh yeah and just so you know its Oh-nek-a not One-ka!
Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 11th Nov 2004 10:15
Don't know.
*tests in advanced terrain*

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th Nov 2004 11:51
Errr.. Ilya, That post where you said you attached a Heightmap.. Cant seem to get it.. Might be a bug in the forums.. dunno..

If you wanna email me, its njt1982@yahoo.com

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 11th Nov 2004 20:12
That's true.

Try this 7-zip file:

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Nov 2004 22:10
What Ilya that image looks nice. What have you changed in the code?

AKA teh great Pet Rat.
Peace sells...but who's buying??
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 11th Nov 2004 22:37
That looks nice!!

A few points I'd like to make..

(1) Can you put a timer in the bit where it produces the image.. Easy to do, make a note of the time at the begining of the routine (startTime = timer()) then display the difference ((timer() - startTime) * 0.001)

(2) A smoothing routine over the final image would make it look quite nice!!

(3) How do you make your heightmaps? I have Texture Maker and Paint Shop Pro 9..

Ilya
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 12th Nov 2004 04:47
Adavnced Terrain for some reason aligns the terrain and heightmap wrong. It doesn't look really good in Advanced Terrain anyway(but it might if the alignment is right).

I mostly changed the shader routine(so it doesn't go off the edge of the bitmap). I probably changed some other things.

(1) I'll include that in the next build(maybe today)
(2) Same.
(3) Generator/Perlin Noise/Default In TM, then added some /Mountains.

Quote: "I've seen the word programming and I'm not sure what it means. Anybody please explain?"


Quote: "We shouldn't sacrifice the truth to preserve "balance"."

Login to post a reply

Server time is: 2024-11-22 22:29:51
Your offset time is: 2024-11-22 22:29:51