Quote: "Maybe "Ravenous"?"
"The Ravening"?
Quote: "Ravening - (of a ferocious wild animal) Extremely hungry and hunting for prey."
You can't even see the sky!? Wow my monitor must be set really bright.
[edit]
I adjusted the lighting and actually used the light-map properly this time. Also gave the aliens unique diffuse and specular colourings (with a kind of pearlescent effect), I think it looks good but what do you guys think?
If this still looks too dark then we need more lights in the scene because if the ambience is any brighter it will look like day.
rem load in the DBC library files
#include "inc_dbccoldet.dba"
` DBC Guard the Farm game
gosub _init
gosub _stars
gosub _load_objects
gosub _setup_ships
position camera 150,30,200
position mouse halfscreenwidth,halfscreenheight
do
frim#=gettime()
rem spazzy torch control for light testing
oldspace = newspace
newspace = spacekey()
if newspace > oldspace
if light visible(1) then hide light 1 else show light 1
endif
if timer() > place_ship_delay then gosub _place_ship
position light 1,camera position x(),camera position y()+20,camera position z()
scroll object texture 20,.00001,.00005
gosub _move_ships
for tt = 1 to 10 : gosub _move_NPCs : next tt
gosub _move_camera
gosub _debug
sync
loop
end
`----------------------------------------------------------------
_init:
` max43_on_widescreen(0,0,0)
set display mode 800,600,32
sync on
sync rate 0
halfscreenwidth=screen width()/2
halfscreenheight=screen height()/2
sensitivity#=0.5
rem set up the arrays needed by the library to store memblock info
rem reserve memblocks to return most values
dim colmem(3,2)
colmem(1,1) = 247
make memblock colmem(1,1),12 : rem store 3 floats if necessary
colmem(1,2) = get memblock ptr(colmem(1,1))
colmem(2,1) = 248
make memblock colmem(2,1),18*4 : rem store 18 floats
colmem(2,2) = get memblock ptr(colmem(2,1))
colmem(3,1) = 249
make memblock colmem(3,1),10*4 : rem store 40 floats
colmem(3,2) = get memblock ptr(colmem(3,1))
coldll=1
load dll "dbcwithcoldet.dll",coldll
coldetInitalize(coldll,0)
dim getsliding#(2)
autocam off
hide mouse
next_image = 1 : next_object = 1 : total_ships = 5 : total_monsters = 50
current_monster = 0
place_ship_delay = timer() + rnd(1000) + 1000
rem lighting
color backdrop 0
color ambient light rgb(100,80,120)
fog on
fog color rgb(35,25,45)
fog distance 1000
`moonlight
color light 0,rgb(255,255,255)
set directional light 0,1,-.5,-1
`player light
make light 1
set point light 1,camera position x(),camera position y(),camera position z()
color light 1,rgb(255,255,160)
set light range 1,800
return
`----------------------------------------------------------------
_load_objects:
farm = next_object
inc next_object
farm_lm = next_object
inc next_object
load object "farm.x",farm
load object "farm_lmap.x",farm_lm
ghost object on farm_lm,1
`hide object farm_lm
coldetSetupObject(coldll,farm,0)
set object ambient farm, rgb(30,15,40)
set object diffuse farm, rgb(180,200,180)
set object ambient farm_lm, rgb(160,160,160)
set object diffuse farm_lm, rgb(255,512,255)
`SET OBJECT Object Number, Wireframe, Transparency, Cull, Filter, Light, Fog,ambient
set object farm,1,1,1,1,1,1
set object farm_lm,1,1,1,1,1,0
` NPCs
dim NPC(total_monsters,10)
for j = 1 to total_monsters
NPC(j,4) = next_object
inc next_object
load object "Alien Mutant\H-Alien Mutant-Idle.x",NPC(j,4)
set object ambient NPC(j,4), 0
aliendiffuse = rgb(rnd(20)+30,rnd(25)+25,rnd(50)+40)
set object diffuse NPC(j,4), aliendiffuse
set object specular NPC(j,4), rgb(80-rgbr(aliendiffuse), 80-rgbg(aliendiffuse), 120-rgbb(aliendiffuse)),1000
set object NPC(j,4), 1, 1, 1, 1, 1, 0
yrotate object NPC(j,4),180.0
fix object pivot NPC(j,4)
scale object NPC(j,4),1500.0,1500.0,1500.0
hide object NPC(j,4)
NPC(j,3) = 0 : ` status = inactive
next j
return
`----------------------------------------------------------------
_move_camera:
remstart
move camera (keystate(17)- keystate(31)) * 5
position camera camera position x(),30,camera position z()
yang# = wrapvalue(camera angle y() + mousemovex() )
xang# = xang# + mousemovey()
if xang# < -80 then xang# = -80
if xang# > 75 then xang# = 75
rotate camera wrapvalue(xang#),yang#,0
remend
camrotx#=wrapvalue((mousey()-halfscreenheight)*sensitivity#+camera angle x())
camroty#=wrapvalue((mousex()-halfscreenwidth)*sensitivity#+camera angle y())
position mouse halfscreenwidth,halfscreenheight
if camrotx#<270.0 and camrotx#>180.0 then camrotx#=270.0
if camrotx#>90.0 and camrotx#<=180.0 then camrotx#=90.0
rotate camera camrotx#,camroty#,camera angle z()
gravspeed#=175.0
inc grav#,gravspeed#*frim#
grav#=camStrafe(coldll,0,10.0,15.0,15.0,100.0,grav#,0.0,frim#)
return
`----------------------------------------------------------------
_move_ships:
for j = 1 to total_ships
if ship(j,3) = 2 : ` descending
y# = object position y(ship(j,4) )
if y# > 75.0
dec y#,1.0 : ` move ship downward
if y# > 150.0 and y# < 300.0 then dec y#,2.0
if y# > 300.0 and y# < 500.0 then dec y#,4.0
if y# > 500.0 and y# < 1000.0 then dec y#,8.0
if y# >= 1000.0 then dec y#,12.0
position object ship(j,4),object position x(ship(j,4) ),y#,object position z(ship(j,4) )
else
` ship is hovering above ground - change status
ship(j,3) = 3 : ` hovering, waiting for monsters to appear
ship(j,7) = timer() + 1500 : ` delay for how long the ship stays there - 1.5 seconds
` activate beam
if object exist(200 + j) = 0
make object cylinder 200 + j,40 : color object 200 + j,rgb(0,255,0)
scale object 200 + j,100.0,200.0,100.0 : ghost object on 200 + j
endif
position object 200 + j ,object position x(ship(j,4) ),y# - 30.0,object position z(ship(j,4) )
show object 200 + j
monsters_left = 0
for i = 1 to 50
if NPC(i,3) = 0 then inc monsters_left
next i
if monsters_left > 0
` place 2 - 6 monsters there
cm = 0 : avbl = 0
` get beam location
x# = object position x(200 + j) - 10.0 : z# = object position z(200 + j)
monsters_to_place = rnd(4) + 2
if monsters_to_place > monsters_left then monsters_to_place = monsters_left
for k = 1 to monsters_to_place
` check to see if one is available
avbl = 0
repeat
inc cm
if avbl = 0 and NPC(cm,3) = 0 then avbl = cm
until avbl > 0 or cm >= total_monsters
if avbl > 0
NPC(avbl,3) = 1 : ` status = active
if k = 4 then inc z#,10.0 : x# = object position x(200 + j) - 40.0
position object NPC(avbl,4),x# + (k * 10),7.0,z#
show object NPC(avbl,4)
endif
next k
endif
endif
endif
if ship(j,3) = 3 : ` hovering
if timer() > ship(j,7)
ship(j,3) = 4 : ` change status to ascending
hide object 200 + j : ` hide the tractor beam
else
ya# = object angle y(200 + j)
ya# = wrapvalue(ya# + 5.0)
yrotate object 200 + j,ya#
endif
endif
if ship(j,3) = 4 : ` ascending
y# = object position y(ship(j,4) )
if y# < 300.0
inc y#,2.0 : ` move ship upward
endif
if y# >= 300.0 and y# < 500.0 then inc y#, 4.0
if y# >= 500.0 and y# < 1000.0 then inc y#,8.0
if y# >= 1000.0 then inc y#,12.0
position object ship(j,4),object position x(ship(j,4) ),y#,object position z(ship(j,4) )
if y# > 2000.0 : ` hide ship and change status to available
ship(j,3) = 0 : hide object ship(j,4)
endif
endif
next j
return
`----------------------------------------------------------------
_move_NPCs:
inc current_monster
if current_monster > total_monsters then current_monster = 1
if NPC(current_monster,3) = 1
` just landed - select rotation direction to turn toward waypoint
xa# = object angle x(NPC(current_monster,4) )
ya# = object angle y(NPC(current_monster,4) )
za# = object angle z(NPC(current_monster,4) )
point object NPC(current_monster,4),153.0,object position y(NPC(current_monster,4) ),-159
newY# = object angle y(NPC(current_monster,4) )
NPC(current_monster,6) = newY# : ` target angle
NPC(current_monster,5) = 4 : ` default is clockwise
if newY# < ya# then NPC(current_monster,5) = 8 : ` counter - clockwise
rotate object NPC(current_monster,4),xa#,ya#,za#
NPC(current_monster,3) = 2 : ` status = rotating to correct angle so it points toward the waypoint
endif
if NPC(current_monster,3) = 2 : ` rotating to correct angle
ata# = 7.0
if NPC(current_monster,5) = 8 then ata# = -7.0
ya# = object angle y(NPC(current_monster,4) )
ya# = wrapvalue(ya# + ata#)
if abs(ya# - NPC(current_monster,6) ) < 10.0
` monster has rotated enough - change status to walking toward waypoint
NPC(current_monster,3) = 3 : ` walking toward waypoint
else
yrotate object NPC(current_monster,4),ya#
endif
endif
if NPC(current_monster,3) = 3 : ` walking toward waypoint
move object NPC(current_monster,4),1.0
` check to see if it has arrived
endif
` 153, -159
return
`----------------------------------------------------------------
_stars:
bmp=1
while bitmap exist(bmp)
inc bmp
endwhile
create bitmap bmp,512,512
stars = 300
cls 6
for n=1 to 300
g = rnd(255)
g = (g*n)/300
ink rgb(g,g,g),0
dot rnd(512),rnd(512)
next n
get image stars,0,0,512,512,1
sync
delete bitmap bmp
set current bitmap 0
rem put a star map out there
make object sphere 300,-20000
texture object 300,stars
ghost object on 300
scale object texture 300,4,4
make object sphere 301,-18000
texture object 301,stars
scale object texture 301,3,3
ghost object on 301
set object 300,1,1,1,1,1,0
set object 301,1,1,1,1,1,0
set camera range 1,20000
color backdrop 0
return
`----------------------------------------------------------------
_setup_ships:
rem store ship x# and z# placement data in an array
dim coord(17,2)
restore _ss_coordinates
for j = 1 to 17
read coord(j,1),coord(j,2)
next j
temp = next_image
inc next_image
load image "SSMap.png",temp
dim ship(total_ships,7)
for j = 1 to total_ships
ship(j,4) = next_object
inc next_object
ship(j,5) = 1 : rem type of ship, in case we add more kinds of ships in the future
load object "SpaceShip.x",ship(j,4) : ` export from MS3D at 12.0
texture object ship(j,4),temp
set object ship(j,4),1,1,1,1,1,0 : `Wireframe, Transparency, Cull, Filter, Light, Fog
set object ambient ship(j,4),0
set object diffuse ship(j,4),rgb(80,70,80)
hide object ship(j,4)
ship(j,3) = 0 : ` status = inactive
ship(j,6) = 0 : ` location
rem ship(j,7) is used for a timer to control how long the ship remains while the monsters unload
next j
return
`----------------------------------------------------------------
_place_ship:
rem first see if we even need to send a ship
monsters_left = 0
for i = 1 to 50
if NPC(i,3) = 0 then inc monsters_left
next i
if monsters_left = 0 then return : ` all of the monsters are in use already - no need to send a ship
rem see if we have a ship available
avbl = 0
for j = 1 to total_ships
if avbl = 0 and ship(j,3) = 0 then avbl = j
next j
if avbl = 0 then place_ship_delay = timer() + rnd(5000) + 3000 : return : ` no ships available
` ship is available - place it randomly
` make sure you don't place it at the same place another one is
repeat
okay = 1
location = rnd(16) + 1
` check against current ships
for j = 1 to total_ships
if ship(j,3) > 0 and j <> avbl
if ship(j,6) = location then okay = 0
endif
next j
until okay = 1
` store the ship's coordinates
ship(avbl,1) = coord(location,1)
ship(avbl,2) = coord(location,2)
ship(avbl,3) = 2 : ` ship status is descending to earth
ship(avbl,6) = location
position object ship(avbl,4),ship(avbl,1),rnd(500) + 500,ship(avbl,2)
show object ship(avbl,4)
place_ship_delay = timer() + rnd(5000) + 2000 : ` have a 2 - 7 second delay between ships
return
`----------------------------------------------------------------
_debug:
txtx = 10
txty = 10
text txtx,txty,"FPS: " + str$(screen fps() ) : inc txty,16
text txtx,txty,"Press SPACE to toggle flashlight" : inc txty,16
` cx# = camera position x()
` cz# = camera position z()
` text 10,100,"cx: " + str$(cx#)
` text 10,120,"cz: " + str$(cz#)
` text 10,150,"scancode: " + str$( scancode() )
return
`----------------------------------------------------------------
_ss_coordinates:
` x, y coordinates where to place the monster's ships
data -122,819,-416,855,-875,833,-607,398,-885,473,-897,-170,-722,-433,-840,-728
data -698,-929,-495,-805,-239,-829,10,-833,189,-909,376,-737,599,-900,767,-852,900,-597
end
function max43_on_widescreen(todesktop,desiredwidth,desiredheight)
remstart
by latch
10/07/2011
Setup a 4:3 screen on a widescreen display at the maximum possible
resolution within the desktop size to keep the view from being stretched.
If a 4:3 resolution can't be found the default resolution will be the desktop size.
For this function to work properly, windowmode=1 must be set under
SETTINGS in the setup.ini file
todesktop == This will ignore the 4:3 ratio and set the resolution
to the desktop size.
1=to desktop size
0=max 4:3 within desktop
desiredwidth == This is the screen width one wants to run the game in. If
it exists, it will be displayed. Please note this function is
based on running the DBC display in windowed mode so if this
value is larger than the desktop, there will be areas of the screen
that cannot be seen.
if 0 , this parameter will be ignored
desired height == See desiredwidth above - except this applies to screen height
remend
rem get metrics from windows
SM_CXSCREEN = 0
SM_CYSCREEN = 1
BITSPIXEL = 12
hdc=0
load dll "user32.dll",1
load dll "gdi32.dll",2
desktop_width=call dll(1,"GetSystemMetrics",SM_CXSCREEN)
desktop_height=call dll(1,"GetSystemMetrics",SM_CYSCREEN)
hdc=call dll(1, "GetDC", 0)
desktop_depth=call dll(2, "GetDeviceCaps", hdc, BITSPIXEL)
call dll 1, "ReleaseDC", 0, hdc
rem check desiredwidth and height
if desiredwidth > 0 and desiredheight > 0
set display mode desiredwidth,desiredheight,desktop_depth
delete dll 2
delete dll 1
exitfunction
endif
rem compare the metrics to the possible resolutions - lowest common denominator is screen height
perform checklist for display modes
maxvalue=0
for n=1 to checklist quantity()
rem check screen height possibilities
if checklist value b(n) <= desktop_height
if ((checklist value b(n)+0.0)/(checklist value a(n)+0.0))=.75
maxvalue=n
endif
endif
if checklist value b(n) > desktop_height
rem we're at a larger value than our desktop height so get out of loop
exit
endif
next n
rem if the todesktop flag is set then make the screen the size of the desktop
rem this may be widescreen and therefore not function properly in DBC
if todesktop or maxvalue=0
set display mode desktop_width,desktop_height,desktop_depth
else
set display mode checklist value a(maxvalue),checklist value b(maxvalue),desktop_depth
endif
empty checklist
delete dll 2
delete dll 1
endfunction
function camStrafe(coldll,obj,offsety#,radius#,height#,F#,G#,J#,frim#)
F#=F#*frim#
`Set up/down/left/right variables at 0 and set the control angle at invalid
u=0:d=0:l=0:r=0:a=-1
`Get control input for W/S/A/D and arrow keys
if keystate(17) or upkey() then u=1
if keystate(31) or downkey() then d=1
if keystate(30) or leftkey() then l=1
if keystate(32) or rightkey() then r=1
`Determine which direction the player is going
if u=1 and r=1 and l!1 and d!1
a=45
else:if r=1 and u=d and l!1
a=90
else:if r=1 and d=1 and l!1 and u!1
a=135
else:if d=1 and l=r and u!1
a=180
else:if d=1 and l=1 and u!1 and r!1
a=225
else:if l=1 and u=d and r!1
a=270
else:if l=1 and u=1 and r!1 and d!1
a=315
else:if u=1 and l=r and d!1
a=0
endif:endif:endif:endif:endif:endif:endif:endif
`Initialize some variables, taking into account vertical offset and get an angle value relative to the camera's current angle
X1#=camera position x():Y1#=camera position y()-offsety#:Z1#=camera position z():B#=wrapvalue(camera angle y()+a)
`Adjust position variables so you have the parameters for the player's position before and after
X2#=X1#:Y2#=Y1#-(G#*frim#):Z2#=Z1#
if a>=0 then inc X2#,F#*sin(B#):inc Z2#,F#*cos(B#)
`Check for collisions. This part is probably messed up.
G#=slidingCollision(coldll,obj,X1#,Y1#,Z1#,X2#,Y2#,Z2#,radius#,height#,G#,J#,1)
X2#=getsliding#(0)
Y2#=getsliding#(1)
Z2#=getsliding#(2)
`Place the camera where it should go, taking into account the vertical offset
position camera X2#,Y2#+offsety#,Z2#
endfunction G#
function slidingCollision(coldll,obj,X1#,Y1#,Z1#,X2#,Y2#,Z2#,r#,height#,G#,J#,ai)
co#=0.0
jumpable=0
x#=X2#
y#=Y2#
z#=Z2#
ra#=r#*0.7071
yco#=y#+co#
if ai=0
gosub raycollisions
if coldetSphereObjectCollision(coldll,obj,x#,Y1#,Z1#,ra#)>0
x#=X1#
endif
if coldetSphereObjectCollision(coldll,obj,X1#,Y1#,z#,ra#)>0
z#=Z1#
endif
endif
r1=coldetRayObjectCollision(coldll,obj,X1#,Y1#+co#,Z1#,X2#,Y2#+co#,Z2#,0,0.0,1.0)
if r1>0
jumpable=0
x#=X1#
y#=Y1#+co#
z#=Z1#
endif
gosub raycollisions
getsliding#(0)=x#
getsliding#(1)=y#
getsliding#(2)=z#
if jumpable=1 and spacekey() then G#=J#*-1.0
exitfunction G#
`For the sake of Dark Survival 2, we make it so the player can't fall through the invisible floor.
floorcollisions:
lowesty#=height#
if yco#<lowesty#
y#=lowesty#+co#
G#=0.0
if J#>0.0 then jumpable=1
endif
return
raycollisions:
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#-r#,yco#,z#,0,0.0,1.0)>0
x#=coldetGetCollisionX(coldll)+r#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#+r#,yco#,z#,0,0.0,1.0)>0
x#=coldetGetCollisionX(coldll)-r#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#,yco#,z#-r#,0,0.0,1.0)>0
z#=coldetGetCollisionZ(coldll)+r#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#,yco#,z#+r#,0,0.0,1.0)>0
z#=coldetGetCollisionZ(coldll)-r#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#+ra#,yco#,z#+ra#,0,0.0,1.0)>0
x#=coldetGetCollisionX(coldll)-ra#
z#=coldetGetCollisionZ(coldll)-ra#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#-ra#,yco#,z#-ra#,0,0.0,1.0)>0
x#=coldetGetCollisionX(coldll)+ra#
z#=coldetGetCollisionZ(coldll)+ra#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#+ra#,yco#,z#-ra#,0,0.0,1.0)>0
x#=coldetGetCollisionX(coldll)-ra#
z#=coldetGetCollisionZ(coldll)+ra#
endif
if coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#-ra#,yco#,z#+ra#,0,0.0,1.0)>0
x#=coldetGetCollisionX(coldll)+ra#
z#=coldetGetCollisionZ(coldll)-ra#
endif
r1=coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#,yco#+r#,z#,0,0.0,1.0)
if r1>0
if J#<0.0 then jumpable=1
if G#<0.0 then G#=0.0
y#=coldetGetCollisionY(coldll)+co#-r#
endif
gosub floorcollisions
r1=coldetRayObjectCollision(coldll,obj,x#,yco#,z#,x#,yco#-height#,z#,0,0.0,1.0)
if r1>0
if J#>0.0 then jumpable=1
if G#>0.0 then G#=0.0
y#=coldetGetCollisionY(coldll)+co#+height#
endif
return
endfunction G#
function gettime()
oldtime=time
time=timer()
frim#=(time-oldtime)*0.001
if frim#>1.0 then frim#=1.0
if frim#<0.0 then frim#=0.0
if keystate(183)
rem get the date
date$=get date$()
date$=mid$(date$,7)+mid$(date$,8)+"-"+mid$(date$,1)+mid$(date$,2)+"-"+mid$(date$,4)+mid$(date$,5)
sync
rem save the image
get image 999,0,0,screen width(),screen height()
save image date$+"_"+str$(timer())+".bmp",999
delete image 999
sleep 500
endif
endfunction frim#
Shh... you're pretty.