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.

Code Snippets / [DBP] grid-based map generation

Author
Message
Neuro Fuzzy
10
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 2nd Oct 2010 01:14 Edited at: 29th Oct 2010 23:48
This is a thing from a while ago, but I think its a cool bit of code. Its a map generator that generates crappy city-block style maps. It needs media, so I've attached the whole project, along with the source code visible here:

+ Code Snippet



download here: http://forumfiles.thegamecreators.com/download/2100485



[edit]
and screenshots:



[edit2]
and of course all the media is free fo' anyone to use.

Attachments

Login to view attachments
Carolina South
12
Years of Service
User Offline
Joined: 28th Sep 2004
Location: South Carolina
Posted: 4th Oct 2010 01:17
Very cool. Very City of Heroes-like

"Diplomacy is the art of saying 'Nice doggie' until you can find a rock." - Will Rogers

"The secret to creativity is knowing how to hide your sources." - Albert Einstein
DevilLiger
13
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 19th Oct 2010 14:06
looks interesting. can the buildings be in different sizes?

Neuro Fuzzy
10
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 20th Oct 2010 23:04
width/depthwise or vertical? Vertical, no problem, it just needs a different model (the structure exists to be able to add in any number of building models, I've just only modeled one).

As for width/depth sizing, I figure I could add in a system similar to what I'm using for roads. It wouldn't be hard to do... But it'd require 6 models.

It'd be time better spent making a procedural content generator.

DevilLiger
13
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 29th Oct 2010 13:22
okay that's cool. i just rather have them look different mainly in height and maybe without making them looking like clones. i think it's possible to make more models and just randomize it. btw you have an excellent code here. do you have anymroe pics of it. like any pic of it from the road view?

Neuro Fuzzy
10
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 29th Oct 2010 23:41
I attached the file to download - it generates a random map, and you can zoom in, but sure, I'll upload some more pics

DevilLiger
13
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 30th Oct 2010 13:30
wow!! looks awesome from the road view. thanks for the code and pics. keep up the good work.

gwheycs62egydws
7
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Feb 2011 21:43
good day

I like what you did Neuro Fuzzy

I had a tiny quirk when I ran the code

Constant name 'moving' cannot share the name of a reserved word or command.
Failed to 'UnfoldFileDataConstants'

at line 121
#constant moving 2 ` ==


I changed it to

#constant zmoving 2 ` ==

I'm using dbp 7.6 and Matrix1Util and a couple of other open source addons
so it could be one of them that is tweaking things

but it dose work and quite quickly for a 2.8 dual cpu

If a thought is Just a thought ~ so whats the main thought ?
gwheycs62egydws
7
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 13th Feb 2011 22:11
hi again

I wanted to know ware the Zombie was

so I added these 2 lines

text 0,20,"Zombie Position is "+" x ="+str$(OBJECT POSITION X(7))+" y ="+str$(OBJECT POSITION y(7))+" z ="+str$(OBJECT POSITION z(7))
text 0,40,"Camera Postion is "+" x ="+str$(CAMERA POSITION X() )+" y ="+str$(CAMERA POSITION y() )+" z ="+str$(CAMERA POSITION z() )

after text 0,0,str$(Duration)
at line 189

it seems the Zombie is way off the visible system

If a thought is Just a thought ~ so whats the main thought ?
sadsack
13
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 20th Feb 2011 01:53
Is there a way to save the map as an object??
renny

Life is not fair, so deal with it.
http://www.gusroundtable.com/
gwheycs62egydws
7
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 20th Feb 2011 02:21 Edited at: 20th Feb 2011 02:51
from what I have looked at
at this point no

but I know there is a way to save the information
that is generated so it can be loaded in to anther program

if I am not mistaken I have seen code some ware that will
let some one save an object as .x file

that will take some more thinking to make such happening
but it is possible

if you give me some time I can come up with code for saving
the generated level to be loaded into anther program

one other thing to be pointed out
if you were to save every 3d object in a single file
it would be large

I changed the size of the city to be generated from 25 to 50
so I know that would be a large file and take up a lot of memory
and time to load

so just saving the information ware I am is in the generated
world would be much much smaller and quicker to load

and if you a building or road was damaged it could be changed
on the fly unlike all the extra code needed to take the model apart

after 10 years at looking at code now I can at lest tweak thing
or even program in code to help me understand

If a thought is Just a thought ~ so whats the main thought ?
sadsack
13
Years of Service
User Offline
Joined: 27th Nov 2003
Location: here
Posted: 20th Feb 2011 16:07
thanks
renny

Life is not fair, so deal with it.
http://www.gusroundtable.com/
gwheycs62egydws
7
Years of Service
User Offline
Joined: 17th Aug 2009
Location: The World
Posted: 6th Jun 2011 11:16
I hope with the new additions
I picked up to give even more option

it all takes time to pull the thought together

If a thought is Just a thought ~ so whats the main thought ?
DevilLiger
13
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 10th Jul 2011 12:49
This is still one cool code.

DevilLiger
13
Years of Service
User Offline
Joined: 21st Nov 2003
Location: Fresno,CA,USA
Posted: 27th Jul 2011 11:06 Edited at: 2nd Aug 2011 08:00
hmm i need to do this code on my next project. if im right i can modify these models to get a variety of them.

edit: i might use this for a city for a FPS game im planning to build on. i hope my open sandbox type FPS shooter can turn out well base on my plans. oh well but im planning to use this code and later on use different kinds of buildings.

Login to post a reply

Server time is: 2017-06-25 09:45:02
Your offset time is: 2017-06-25 09:45:02