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.

3 Dimensional Chat / help with huge 3d Dungeon tut

Author
Message
Mike B
22
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: kent,wa
Posted: 23rd Jun 2004 23:13
i under stand the whole tut. but cant get my own maps to work they load but the walls wont be in the right places can any one help fix this problem
Mike B
22
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: kent,wa
Posted: 24th Jun 2004 08:32
do you guys know the tutorial im talking about its on this web site in the tut. section for dbpro there map works fine but none of mine do.
LordoFire
22
Years of Service
User Offline
Joined: 14th Feb 2004
Location: United States
Posted: 24th Jun 2004 09:02
well... No we dont know what site because you have not told us. Posting a hyperlink or even just the url address would be helpful and then we would know what you are talking about. Be more specific...
cheers,
Evan

When it comes to programing, I'm on fire!
Mike B
22
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: kent,wa
Posted: 24th Jun 2004 09:18
here is the link to the page its on, the tut. is about half way down its called huge dungeons
http://developer.thegamecreators.com/?f=dbpro_tutorials
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Jun 2004 12:53
I'd suggest making a demo of your problem then uploading it - I'm sure it'll be pretty easy to solve, but it's probably something with your engine, not the uploaded source.

Maybe look at the scale, make sure your boxes are the right size for example, and also check and make sure it's loading the data correctly.


Van-B


The nature of Monkey was irrepressible!.
Mike B
22
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: kent,wa
Posted: 24th Jun 2004 22:15 Edited at: 24th Jun 2004 22:16
ok here is the code adn the map that goes into a notepad file saved as mapp.map
####
#o:#
#::#
####

here is the code:

`set display mode 800,600,16
sync on
sync rate 0
hide mouse

backcolor=rgb(0,0,0)

backdrop on
color backdrop backcolor
cls

` Attention ... This value is the size of the map ! change it to fit your map file
mapsize=4
dim map$(mapsize,mapsize)

maxcubes=16
cubesize=32
collisionstep=int(cubesize/10)

fog on
fog color backcolor
fog distance (int(maxcubes)*cubesize)
set camera range 1,(maxcubes*cubesize)

` Current map
loadmap("media/mapp.map",mapsize)
autocam off

load image "media/wall2.jpg",1
load image "media/ground.jpg",2
load image "media/wall.jpg",3

` Wall … you can change the walls to other objects J
for i=1 to maxcubes*maxcubes
make object cube 100+i,cubesize
` make object sphere 100+i,cubesize
` make object box 100+i,cubesize,cubesize*2,cubesize
` make object cone 100+i,cubesize
` make object cylinder 100+i,cubesize+((cubesize/100)*10)
texture object 100+i,1
next i

` floor
for i=1 to maxcubes*maxcubes
make object plain 10000+i,cubesize,cubesize
rotate object 10000+i,90,0,0
texture object 10000+i,2
next i

` ceiling
for i=1 to maxcubes*maxcubes
make object plain 20000+i,cubesize,cubesize
rotate object 20000+i,270,0,0
texture object 20000+i,3
next i

set ambient light 30
make light 1
make light 2
set point light 1,0,0,0
set spot light 2,45,90
color light 2,RGB(252,216,141)
color light 1,RGB(236,182,100)
color light 0,RGB(0,0,0)

` Search startpoint
for z=1 to mapsize
for x=1 to mapsize
if map$(x,z)="O"
cx=x*cubesize
cz=z*cubesize
endif
if map$(x,z)="U"
ex=x
ez=z
endif
next x
next zd
position camera cx,0,cz

oldpositionx#=camera position x()
oldpositionz#=camera position z()

randomize timer()
cls

do
if mouseclick()=1 then move camera maxcubes
if mouseclick()=2 then move camera maxcubes*(-1)
ry#=wrapvalue(ry#+mousemovex())
rotate camera rx#,ry#,0

cx#=int(camera position x()/cubesize)-int(maxcubes/2)
cz#=int(camera position z()/cubesize)-int(maxcubes/2)

tx#=camera position x()
tz#=camera position z()

zzz=0
for zz=1 to maxcubes
for xx=1 to maxcubes
zzz=zzz+1
curposx=int(cx#)+xx
curposz=int(cz#)+zz
if curposx<=1 then curposx=1
if curposx>=mapsize then curposx=mapsize
if curposz<=1 then curposz=1
if curposz>=mapsize then curposz=mapsize

` wall
if map$(int(curposx),int(curposz))="#" or map$(int(curposx),int(curposz))="S"
show object 100+zzz
position object 100+zzz,curposx*cubesize,0.0,curposz*cubesize
` Collisiondetection
if map$(int(curposx),int(curposz))="#"
if tx#>=((curposx*cubesize)-(cubesize/2))-collisionstep and tx#<=((curposx*cubesize)+(cubesize/2))+collisionstep and tz#>=((curposz*cubesize)-(cubesize/2))-collisionstep and tz#<=((curposz*cubesize)+(cubesize/2))+collisionstep
position camera oldpositionx#,camera position y(),oldpositionz#
oldpositionx#=camera position x()
oldpositionz#=camera position z()
endif
endif
else
hide object 100+zzz
endif

` floor
if map$(int(curposx),int(curposz))=":" or map$(int(curposx),int(curposz))="D" or map$(int(curposx),int(curposz))="S" or map$(int(curposx),int(curposz))="T"
show object 10000+zzz
position object 10000+zzz,curposx*cubesize,(cubesize/2)*(-1),curposz*cubesize
else
hide object 10000+zzz
endif

` ceiling
if map$(int(curposx),int(curposz))=":" or map$(int(curposx),int(curposz))="D" or map$(int(curposx),int(curposz))="S" or map$(int(curposx),int(curposz))="T"
show object 20000+zzz
position object 20000+zzz,curposx*cubesize,(cubesize/2),curposz*cubesize
else
hide object 20000+zzz
endif

next xx#
next yy#

oldpositionx#=camera position x()
oldpositionz#=camera position z()

position light 1,camera position x(),camera position y(),camera position z()
position light 2,camera position x(),camera position y(),camera position z()
color light 1,RGB(200+int(rnd(50)-25),120,60)
rotate light 2,camera angle x(),camera angle y(),camera angle z()

sync
loop

function loadmap(filename$,size)
open to read 1,filename$
for y=1 to size
for x=1 to size
read byte 1,tmp
map$(x,y)=chr$(tmp)
next x
next y
close file 1
endfunction
Mike B
22
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: kent,wa
Posted: 1st Jul 2004 06:00
well i discovered its not the source no matter what map i use mine or the one the tutorial came with the program reads it incorrectly, can any one help fix this? here is a link to the page the tut is on its called Huge Dungeons.
http://developer.thegamecreators.com/?f=dbpro_tutorials
thanks for your help!
Mike B
22
Years of Service
User Offline
Joined: 23rd Jun 2004
Location: kent,wa
Posted: 23rd Jul 2004 14:59
great forum no one can help me??
JaJaPuppy
21
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Southport, UK
Posted: 8th Aug 2004 02:40
Hi Mike B

Can't actually help you yet BUT thought you might like to know I have the same problem!!
bitechu
22
Years of Service
User Offline
Joined: 29th Dec 2003
Location: Massachusetts
Posted: 8th Aug 2004 11:54 Edited at: 8th Aug 2004 12:59
Thats strange..I just downloaded and unzipped the source and it compiled fine....what error messages are you getting (I have DBPro v1.055)?

Also change your map so it looks like this

#####O:##::##### (all on one line in notepad)
JaJaPuppy
21
Years of Service
User Offline
Joined: 20th Jul 2004
Location: Southport, UK
Posted: 9th Aug 2004 05:04
The problem I get isn't that it won't compile. What happens is it just bombs out when it tries to execute the loadmap line. The loadmap function matches the one in the tutorial line for line.
Shadow Coder
21
Years of Service
User Offline
Joined: 15th Aug 2004
Location:
Posted: 15th Aug 2004 23:12 Edited at: 15th Aug 2004 23:14
I see the problem. You really wanna make a huge dungeon thats only 4x4? Make sure your mapsize in the code matches up with the actual size of your map. The default mapsize for the map that comes with the tut is 512. It is possible that 4 is way too small for the code to work right....hence why its called "huge dungeon" Also make sure the map you're trying to load has the same name as what you have in the code and also make sure the map is in the same directory as the exe.

Any code can be written in light....Code written in Shadow...now there's something interesting.

Login to post a reply

Server time is: 2026-07-07 12:06:06
Your offset time is: 2026-07-07 12:06:06