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 / Doom/wolfenstein engine using sprites - prototype for app kit

Author
Message
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 30th Apr 2011 14:00
Quote: "I think angled walls aren't always needed. I mean, even in Real-Life we have small amout of 'angled walls' ."

Angled walls are awesome for tight dark secret corridors
And gives you the option to give your rooms any shape

Quote: "I might try to help you... but i really don't understand the idea of 2d to 3d raycasting.
Maybe you could help me off with that, so i can actually help you?"

Sounds like me when i started with this
My best tip is to look at the same tutorial i started with!
http://www.permadi.com/tutorial/raycast/index.html
I have a couple of links to good sites about raycasting on the first page!
mint sandcastle
14
Years of Service
User Offline
Joined: 11th Mar 2010
Location:
Posted: 1st May 2011 15:51
hi
can i throw some thoughts in here?
are you still looking at fake matrix? sprite floor texture thing.ive been messing about. i was thinking about snes mode7 and how you could do something that looked similar . im all for using some dirty bodge instead getting boged down in maths which i think is what your looking for. sorry if this isnt it. im rotating the floor plan and grabbing horizontal sections from it. im getting a low frame rate on a desktop. between 5 and 75 depending on res of floor. have a play if you like anyway.


sorry if this doesnt really relate or help with your floor issue.
maybe it would be useful if someone wanted to do a game like mariokart only that ran really slowly! rotating the floor texture is the issue. i dont really have an answer for that. maybe memblocks could speed things up a bit generally. i dont know if memblocks will feature in app kit.
alinment with the walls would be a problem. i guess you could adjust the field of view of the 3d camera and the camera hieght and scale of floormap in realtime until it matched. it would be a pain.
i like the idea of that wolfenstien look. with simple textures and everything im thinking of working with sprites instead of 3d. in the interests of running stuff at speed. maybe doing isometric or isometric with a twist of 2.5d.
thats why i was following your thread. i think ive only succeeded in finding new ways to make the computer crawl.
nevermind.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 1st May 2011 16:29
Quote: "can i throw some thoughts in here?
"

You are always welcome with ideas

Ia will try the code and see waths going on in there
Thanks.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 1st May 2011 16:42 Edited at: 1st May 2011 20:47
I get alot of drawing errors?
But i must say that your code is extremely cool and maybe only nead some adjustments?
I actually think that your code could be fast with some adjustments?
Iam going to look some on the code and please fill me in if you modifie it some more
Thanks alot and its times like this i love the tgc forums
And your code is an extreme good start to make some cool outrun like games on the appkit


Its extremely hard to understand how you have done your code
You cant do it with only 2d commands as your current code uses cameras and objects?

Attachments

Login to view attachments
mint sandcastle
14
Years of Service
User Offline
Joined: 11th Mar 2010
Location:
Posted: 2nd May 2011 01:03
cheers

glad you like it. its an interesting area isn't it, where things stop being sprites scaling and start being tangibly 3d, its just fustrating when you do something cool and then look at the frame rate and think about all it'll take to slowly notch it up.
i think horizontal strips maybe useful for your floor. because you can fill the floor with relatively few of them and trade off between speed and resolution.
compared to a per pixel method

im not sure what those draw errors are. theres junk at the top where its getting data from the background rather than the plane, thats not so much of a problem. but moving the player xy and angle seems to cause it to grab the wrong width of sprite. but it can do it ok when switching between camera heights.
the white lines in the top imply theres not errors in the data as they mostly look as i would expect. im still stumped on that.

yes outrun would be cool. or a demade panzerdragoon type thing. putting sprite scaled objects on top of this should be straight forward.


re edit:
originally i made 2 programs i put them into one so there was only one thing to run. the first program is the 3d one with the 3d plane and the gradient this is what creates the data about the widths the sprites need to be. this is stored in the slicedata(50,300,4). although im updating the cameras 3d position in the main loop all of the data the sprites need is in the slicedata(50,300,4). so 3d commands aren't needed to actually draw the ground spites. the slicedata is read from but not written to. you can save the slicedata and then load it into a program with no 3d commands. im working visually using the dark basic 3d to gather data i can use later. this data could be used in a separate program with only sprite commands.

ive separated it back into 2 programs run them in the same folder. the first one saves an array with the width data.



the second loads in the data to use on the sprites. run this once its saved the data



the first version i did i just typed in the widths of the sprites making them up off my head with wider ones at the top and narrower ones at the bottom.
how you derive the width of the field of vision at the horizon and at each point down the screen is open. it needn't be the way i did it. you could maybe use your own engine to make the data about how wide the floor sprite images would need to be. if you made a level with a long wall with a gradient along it. when you stood next to the wall so the wall was touching the base of the screen, the diference in colour at each side of the screen would give you a width for the botom of the screen. as you moved away from the wall it would rise up the screen giving a grater horizontal width for each "step" you took backwards. until the wall was on the horizon. you would still neeed to scale the floor plan but you would have data about all the relitive sizes that matched to your raycasted 3d world. i took the data from the dark basic 3d model because i like to work visually. im sorry if ive thrown you offtrack or caused confusion.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 2nd May 2011 17:58
I have found that the main slow down of your code is simply that you grab parts of the image for the slices !
You dont think it faster with the get bitmap command?
And i simply dont know how it would work with an large area with different textures?
But i will look some more on your code to se if i can get some more ideas from it
Would be great if you could make it work with an grid map?
Where each grid tile is 64x64 pixels in size.

Iam working very hard on the z depth buffer right now as it eats so much resources
And i nead it to be fast and handle alot of depth layers as it will draw everything later on walls,enemys barrels and windows etc.
So if it dont work so is there no true engine to talk about
cheers

Ps..
very hard to focus now when we have such nice spring here in sweden
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 2nd May 2011 18:35
Render only the stuff you actually see, also it gives sense to the strong darkenning for far away objects you have implemented, and also you could do some kind of mipmapping to take less time with things that are only a couple of pixels on the screen anyway.

-In.Dev.X: A unique heavy story based shoot'em ~12%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Non Sequitur M
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 2nd May 2011 22:02
Haha! Road Rash and Darkstone! Darkstone is one of my all time favorite RPGs!

Anyway, on topic. Those windows look amazing! REALLY amazing! I've never seen a raycast game use such nice raycasting for windows! Brilliant! Keep it up man! You're making retro look good!

BTW, been meaning to ask, is this all DBP, or are you using DLLs and/or custom C++ work? 'Cause I've never see anyone code such an efficient raycast engine in DBP.

If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.

Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 2nd May 2011 23:57 Edited at: 3rd May 2011 01:06
Quote: " Darkstone is one of my all time favorite RPGs!"

I must say that its extremely fun and addictiv
Love that game!
Quote: "Anyway, on topic. Those windows look amazing! REALLY amazing! I've never seen a raycast game use such nice raycasting for windows! Brilliant! Keep it up man! You're making retro look good!"

Its actually very simple
I only pasted an rectangle with an alpha colour on the texture
So its not the raycast engine more an texture thing
Iam experimenting alot with various shortcuts to save framerate.
But yes it looks good.
I will try to make an better raycast engine when i know some more with true cut out windows
Quote: "BTW, been meaning to ask, is this all DBP, or are you using DLLs and/or custom C++ work? 'Cause I've never see anyone code such an efficient raycast engine in DBP."

I have never seen an dbp raycast engine before?
But if it exist ?so would it be cool to get some help from the one that made it
And its pure dbp code and thats probably why i have alot of speed issues ?
I dont want to use any dlls as i dont know wath the appkit will support?

And its thanks to ian ms linecast code that it is possible to do so fast in dbp i think?
Its very fast and gives you alot of options when editing your maps.
Quote: "Render only the stuff you actually see"

Iam actually working on that.
Iam going to do so the editor can mark wath parts of an texture have transparency.
And the rest in the back of the other parts will not be drawn.
should save alot of framerate.
Now does the engine draw everything in the depth of the z buffer!
Paste sprite eats alot that i hope they solved with the appkit?

I included an screenie to show how it works when marking an walls transparency sections.
Also noticed that i nead to optimize the editor also
20 fps when i draw the alpha as i temporary use lines to draw the markers.
You see the white bars above the textures!
You simply press mb 1 and moves across the section you want marked!

Attachments

Login to view attachments
Non Sequitur M
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 3rd May 2011 04:02
Quote: "I have never seen an dbp raycast engine before?"

My bad, rephrase... Haha. I've never seen anyone do it before, so to see it this efficient already is quite impressive, especially when it's all DBP native!

Quote: "Its actually very simple
I only pasted an rectangle with an alpha colour on the texture
So its not the raycast engine more an texture thing
Iam experimenting alot with various shortcuts to save framerate."

Hey. We coders do what we have to. If it works better than something else, it's not a 'shortcut.' If you can save those few FPS, do it.

I would try to give suggestions to help you more, but... The only raycast attempt I've ever made, just used as single ray to cast each wall/ceiling/floor tile. The engine resized them based on the distance from the screen. The walls were already drawn at specific angles. Haha. So, yeah. It wasn't amazing at all.

If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.

Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 3rd May 2011 10:38
Let us not be so amazed please, DBPro won't give up already if a few hundred distance checks need to be made per frame.

I'm not trying to belittle your work at all, and to be honest maybe i'm the most hardcore DB basher here sometimes, but i've been to the limits a few times before and i know this is nothing to crash the poor thing.

-In.Dev.X: A unique heavy story based shoot'em ~12%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
mint sandcastle
14
Years of Service
User Offline
Joined: 11th Mar 2010
Location:
Posted: 3rd May 2011 17:00
Quote: "
"I have found that the main slow down of your code is simply that you grab parts of the image for the slices !"
"


ive run into speed problems before with grabing images. i found it faster to use make meblock from bitmap 0 and then copy and paste between memblocks and then turn meblock back to a bitmap to paste back to the screen.or do memblocks work with images not bitmaps? anyway.i couldnt get it quick enough when like you, i wanted to redraw the whole screen. i was excited when pixel shaders came into dark basic because it allowed me to go back to stuff where id abandoned them at framerates of 8 or 9 and really do the the stuff i wanted. but as your aiming for mobile computing its not an option because you cant count on the hardware supporting it.
plus its another thing to learn. even memblocks are a bit of a pain to get your head round.

i was relying on useing the sprite rotation to rotate players point of view. but yes your right you get bogged down at the get image command. you really want the ground map to be in some sort of array that gets spat onto the screen with as few calculations as possible. moving around an array in x and y is straight foward but those rotations flumox me. you end up needing to work per pixel or atleast horizontally as well vertically beacause of the rotation in a way you dont with the walls.
your right also that scaling up the floor plan presents problems. you want tiles that you take from at the point you draw the ground in front of the player.

i need to let this slosh around in my head some more.

i will drop back in if have any more bright ideas.
ok hang on
an inital thought is that at the moment i have 50 slots in my array for different camera hieghts
what if this was an array with 360 slots for camera rotation at a fixed camera hieght.
oh, that only gives a start and end point. we would need to plot a diaganol line through the ground map to know where to take the pixels from.
we dont want to do any calculations just take that there put it here type stuff.
ok
mmmmm....

ps..
yeah, i went out in the sunshine yesterday. our brains still work on progamming stuff while we're asleep right?
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 3rd May 2011 22:30
Yaaay. Just got back from a 4-day holiday.

So, i'm still following the project (just to let you know ).

Also, i think that i am gong to try some 2d-3d techniques...
Maybe if i will atleast understand it, i will know how to help you
probably .

PS.

That floor raycasting seems to be a veery huge problem .

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 4th May 2011 00:00 Edited at: 4th May 2011 00:06
Quote: "Let us not be so amazed please, DBPro won't give up already if a few hundred distance checks need to be made per frame.

I'm not trying to belittle your work at all, and to be honest maybe i'm the most hardcore DB basher here sometimes, but i've been to the limits a few times before and i know this is nothing to crash the poor thing."

The only problem with dbp and 2d is that its 2d commands are extremely slow!
I use paste sprite alot in this engine and its the part that eats most framerate.
The rest is actually very fast!
Iam thinking about some workarounds with the paste sprite function
Dbp is simply better on 3d then 2d!
Thats the main reason iam working on an type of culling for the paste sprite function.
You can look at the screenie how much it helped that i started to make an basic culling system.
But a long way left to go!


Old without the culling system!


Quote: "i will drop back in if have any more bright ideas. "

you are welcome with some more ideas
Are still working alot on the under the hood basics for the raycaster
Quote: "So, i'm still following the project (just to let you know ).

Also, i think that i am gong to try some 2d-3d techniques...
Maybe if i will atleast understand it, i will know how to help you
probably .

PS.

That floor raycasting seems to be a veery huge problem "

Welcome back then

The main problems are that you nead it to be drawn fast and to work together with the depth buffer.
Will look extremely weird if it dosent
There will be floor and ceiling textures ut i dont know when?
I have so many other things to work on also with the engine!

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 4th May 2011 16:02
Well, nice culling system you've got

Non Sequitur M
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 4th May 2011 19:11 Edited at: 4th May 2011 19:15
Haha. Look how far you've come in these last weeks!

Anyway, I once worked on a pretty efficient way to mask textures on top of one another. I'm going to look into it, and if I can figure out how I did it, I'll show you. I know it involved having both images in arrays and copying the data from one image into the others array. It basically edited both images down to the byte level, but it was awesome for stuff like bullet holes, blood splatters, and even minimaps of all shapes. It also could give bitmaps an alpha layer! But, don't know when you'd need that. Haha.

That makes me think I should make my own image format. With a wicked sweet compression algorithm, and alpha layers... Try to top the png format!

If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.

Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 4th May 2011 19:53
I tried to convert some raycaster code from C++ to DBPro, but i failed . I don't know C++ good enaught and i couldn't understand it.

Too bad. I'll try again i think.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2011 00:18 Edited at: 5th May 2011 00:18
Quote: "Haha. Look how far you've come in these last weeks!"

You always have to start somewhere
Give me a year and we will se how it looks
Quote: "Anyway, I once worked on a pretty efficient way to mask textures on top of one another. I'm going to look into it, and if I can figure out how I did it, I'll show you. I know it involved having both images in arrays and copying the data from one image into the others array. It basically edited both images down to the byte level, but it was awesome for stuff like bullet holes, blood splatters, and even minimaps of all shapes. It also could give bitmaps an alpha layer! But, don't know when you'd need that. Haha."

Sounds cool!
Simply post some snippets here when you do some tests
Anyones code that is used later on will be credited for it

Quote: "I tried to convert some raycaster code from C++ to DBPro, but i failed . I don't know C++ good enaught and i couldn't understand it.

Too bad. I'll try again i think."

My suggestion is that you read there explanations and look on there explaining images.
Then write it your way in dbp!
Thats how i did it
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 5th May 2011 15:33
Quote: "My suggestion is that you read there explanations and look on there explaining images.
Then write it your way in dbp!
Thats how i did it "


Kinda good idea i think . We'll see, i have some other things that i do now.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2011 17:34
Quote: "Kinda good idea i think . We'll see, i have some other things that i do now."

When i first started with this so did i look like an complete jungle of data and facts!
But simply start small like i did
My first attempts whas simply sprites that i shoot like bullets from the player, until they hit something and then rescaled the screen columns acording to the impacts distance.

Now is it a bit more advanced
But extremely simple if you look at it closely
Non Sequitur M
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 5th May 2011 18:47
Quote: "My first attempts whas simply sprites that i shoot like bullets from the player, until they hit something and then rescaled the screen columns acording to the impacts distance."

So, if I read that correctly... The player blasted the level all over the screen to create the level? That's funny.

Also, I started on my file type yesterday. So far, I've got it efficient enough to create an image of 1024x786 with a total file size of 1.5Mb. PNG format creates the same file at 1.25Mb. I'm so close. >.< Anyway, I'm going to knock that out, then I'll get started on recreating that arrayed bitmaps function.

If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.

Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 5th May 2011 23:18
haha - But you had ceiling and floor!

-In.Dev.X: A unique heavy story based shoot'em ~12%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 5th May 2011 23:50 Edited at: 5th May 2011 23:59
Quote: "haha - But you had ceiling and floor!"

Yes!
But do you understand how complicated it is to do ceilings and floors with an z depth buffer in multiple heights?

I think its time for you to prove your self

Show me an raycast engine you do with ceiling and floor textures that aligne to the walls in multiple heights
And all in pure dbp code without plugins!

And i will give you an beer
Non Sequitur M
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 6th May 2011 06:15
Hell! If you do, I got a 12 pack here for ya!



Also, Cliff, are you actually doing multiple floors? If so, good luck. Not that I think you or DBP aren't capable.

If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.

Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 6th May 2011 13:57
Quote: "Also, Cliff, are you actually doing multiple floors?"


I think he's gonna make one height floor first

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 6th May 2011 16:22
Quote: "Also, Cliff, are you actually doing multiple floors? If so, good luck. Not that I think you or DBP aren't capable."

I dont know if iam capable
But iam at least going to try my best.
I didt think i whas capable of doing standard raycasting like the old wolfenstein engine when i started
But i have comed this far so why give upp
And as my biggest supporter writes
Quote: "I think he's gonna make one height floor first "

He is kicking my butt to do floor and ceilings as soon as possible

But be patient as iam really slow sometimes with updates
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: &lt;script&gt; alert(1); &lt;/script&gt;
Posted: 6th May 2011 16:30
watching this thread makes me want to make a rendering engine (such as directX and openGL), nice work you've done!

Non Sequitur M
15
Years of Service
User Offline
Joined: 28th Oct 2008
Location: Where am I!? Where are YOU?
Posted: 6th May 2011 17:42
How I feel waiting for your updates:

Just kidding! I'm not like that. Seriously, no pressure!

Anyway, I've almost got my new file type worked out. Once I'm done with that, I'm going to work on the array system. BTW, have you ever worked with an image in a byte by byte fashion? I'm curious, cause that's how this system works, it allows for transparency and the like to be altered as necessary. I also need to know what format your pictures are, because of headers and the like. You use PNG I hope.

If life were like a box of chocolates, I'd know what I would get... The one that got dropped on the floor and put back in the box.

Iye nehvur yoose spehl chehk, ahn mie tippyng izz fiyne.
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 6th May 2011 17:55
Hmm. Waiting is fun until something happens. Then the fun increases.

Are you already working on the floor?

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 6th May 2011 19:12 Edited at: 7th May 2011 12:02
Quote: "Anyway, I've almost got my new file type worked out. Once I'm done with that, I'm going to work on the array system. BTW, have you ever worked with an image in a byte by byte fashion? I'm curious, cause that's how this system works, it allows for transparency and the like to be altered as necessary. I also need to know what format your pictures are, because of headers and the like. You use PNG I hope."

Never worked with it byte by byte ! sorry
I dont think its important as i can use any format that is neaded!
I use png and bmp currently.
When you are finished simply post an sample code here and i will look in to if i can use it somehow?
Quote: "Are you already working on the floor?"

Iam always working on the floor and all the other things
I have some new ideas for the floor iam going to try this weekend!

I have bin reading alot about bsp trees lately as its something completely new to me!
Here is an link if anyone is intrested?
http://www.gamers.org/dhs/helpdocs/bsp_faq.html

Ps...
Thanks hassan
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th May 2011 12:55
Screens, screens .

Any ?

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 7th May 2011 13:44 Edited at: 7th May 2011 13:49
Quote: "Screens, screens .

Any ?

"

Not yet!
But ok there is an screenie showing the point function that iam going to use for enemys,barrels and stuff.
The wall in the middle always points towards the player!
I know about the texture error as it is the function that gives an extra pixel in width currently .
So iam actually working with a bunch of stuff so that the next demo can have something more then only walls in the map
Be patient!
I noticed some very weird parts with dbp today?
The built in screen fps is wrong?

Started experimenting today and i really dont think i wrote my code wrong?

I get completely differrent fps with an counter inside the loop then with the dbp screen fps command?
Correct me if iam wrong
This is my code!




You get the fps with FPS.Current.

Will not be so much work today as iam going away to grand parents the whole day!

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 7th May 2011 17:46
Yay .

Good that you have enemies ( an allies ) in mind. The only big problem now seems to be that god darn floor . But i think you'll find something out too for it

mint sandcastle
14
Years of Service
User Offline
Joined: 11th Mar 2010
Location:
Posted: 8th May 2011 00:34
ok so, the rotation of the player is now handled in the array.
ive illiminated the getimage comands from my main loop. but ive ended up using sprites in x as well as y.
it tells you how many sprites its using on the screen and its loads. and thats where its slowing down now i think.
it would be nice to think that the app kit will handle sprites faster . i believe they are individual 3d objects for each sprite in dbpro. but any time you want to draw 4000+ sprites i would expect trouble. its hard to speculate how to work around that until we get our hands on it.

all of the drawing to the screen is done in one part of the program and because of x as well as y coordinates it would be easier to match up with a wall drawing part of a program. it would be possible to make it only draw the floor in a vertical colum once it had reached the bottom of a wall.

do try photo textures with the prog. it looks funny. but go carefull as my random texture generator now saves out files.
so it might write over your textures if you dont switch it off.

incidently all the stuff about using the colour on a texture as point in space im sure i got into when i was looking at pixel
shaders. they work quite differently to other stuff ive seen. but you can get ideas to use in db by poking about in different stuff.

how slow are text commands? how much faster do our programs run when they arent writing the fps on the screen?
but seriously ,ive switched off the displays to speed it up a bit but switching them back on gives more of an idea of whats going on.

its in two parts again first to makes the data about the depth from screen. run first



then in the same folder the second draws the 2d version.

looks like you've got a framerate over 100. which with the definiton in the image your getting i think is good going.
the floor and ceiling in wolfenstein make more sense to me now

grey square on top of a slightly lighter grey square. job done!!
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th May 2011 08:25
mint sandcastle, you're like a pro in writing fake 3d for me .

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th May 2011 13:23
Quote: "how slow are text commands? how much faster do our programs run when they arent writing the fps on the screen?"

All text,print,dot,box commands are slow if used to much!
But the little amount of text you have in the second version dont affect that much!
But i think you have alot of dot commands when doing your stuff in the first?
And if you use sync inside an while or for to loop so whil your code slow down alot!

I also wonder why you do this?

You dont nead to show or hide an sprite to paste it on screen

Quote: "all of the drawing to the screen is done in one part of the program and because of x as well as y coordinates it would be easier to match up with a wall drawing part of a program. it would be possible to make it only draw the floor in a vertical colum once it had reached the bottom of a wall."

The floor neads to be drawn the whole way mostly of the time, but you could make it only draw from the bottom on solid walls?

I will look some more in to your code later on as i have alot of buggs with point object and doors currently

And dont think of it to much to aligne to walls! As we are using free angles and free positions on the walls.
The first version could use simple patterns to give illusion of floors and ceilings!

I could send you the current code but its full of buggs that will make it extremely hard for you to test floor and ceiling textures.

My current code is mostly alot of junk code with working code as i test alot of stuff all the time.

Later on have i planned to rewrite it and make it cleaner with the parts i know work

But why worrie as it is an prototype
And still neads to be réwritten in the appkit

Great work so far

And if i could suggest something so is it that you continou to work on this and make it use types and uniqe ids for everything that is used for the floor!
So its easy to implement in to existing code!
You are closer and closer for every update to an mode 7 clone that could be used for many types of games for the appkit!
Maybe make an simple game?

Time to do some more bugg bashing
Design Runner
13
Years of Service
User Offline
Joined: 16th Oct 2010
Location: In my own little world.
Posted: 8th May 2011 16:38
Why raycast the floor? If you could, create a separate system for the floor that simply displays it tiled with rotation, and underneath. Then add some perspective bending, and viola, a floor. Its early so I hope that made sense, if not I will re-write it later.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th May 2011 19:44 Edited at: 8th May 2011 19:45
First screenie of some level extras in action
Starting to get it right now i hope?
Still have some buggs that makes them slightly jitter when you approach them in some angles.
And a bunch of weird editing buggs
They are simply done with an straight line now in the right size, where it uses the middle of the straight line as center.



Quote: "Why raycast the floor? If you could, create a separate system for the floor that simply displays it tiled with rotation, and underneath. Then add some perspective bending, and viola, a floor. Its early so I hope that made sense, if not I will re-write it later."

Its one of the ideas for the first version that dont have multiple heights
But when you tryes to have multiple heights so will it not work!
If you have some ideas feel free to post them here

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 8th May 2011 19:47 Edited at: 8th May 2011 19:48
ooOOooOOO.

Woohoo! That really improved it !

BTW.

can't you just make more of these floor sprites, with set-up size (pretty big size) and just paste them on your level?

PS.

I require some demo .exe .

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th May 2011 19:51 Edited at: 8th May 2011 19:53
Quote: "can't you just make more of these floor sprites, with set-up size (pretty big size) and just paste them on your level?"

It would work as long as its circle shapes as these ones points towards the player .
Wich would make it look weird when the player turns
I could do some experiments later on?
Keep in mind that iam an raycast newbie

Quote: "I require some demo .exe "

To soon !as i want to add more stuff until an new demo!
And still have these frame rate spikes that makes the movement an mess sometimes!
Design Runner
13
Years of Service
User Offline
Joined: 16th Oct 2010
Location: In my own little world.
Posted: 8th May 2011 20:00 Edited at: 8th May 2011 21:15
Alright, I'm out of my tired stupor
The basics of what I am saying is:

if player is at ground level:
display floor sprite under player, at his direction. Scale the furthest end.

if player on stairs = true:
as Y increases, floor scale decreases.

If player is on next floor:
display new floor, same as first floor.

If player is on raised hight:
floor scale is increased or decreased depending on hight. I/E: if a few feet above ground, like a step, increase, but a 50 feet above decrease greatly.

Now just make sure you have floor arranged to be below everything, it should work.
EDIT: you will need to make some way for there to be a fake y axis.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th May 2011 22:02 Edited at: 8th May 2011 22:09
Quote: "Alright, I'm out of my tired stupor
The basics of what I am saying is:

if player is at ground level:
display floor sprite under player, at his direction. Scale the furthest end.

if player on stairs = true:
as Y increases, floor scale decreases.

If player is on next floor:
display new floor, same as first floor.

If player is on raised hight:
floor scale is increased or decreased depending on hight. I/E: if a few feet above ground, like a step, increase, but a 50 feet above decrease greatly.

Now just make sure you have floor arranged to be below everything, it should work.
EDIT: you will need to make some way for there to be a fake y axis."

Its an idea we have talked about earlier!
But the problem comes when the player turns and aint walking in straight lines towards the floor sprites.
And you still have to have the floor sprites as scanlines as it dosent work with an single large sprite for the floor.
You cant simply do diffuse darkening on them correctly so that they match the walls.
But please show wath you mean with an code snippet
Its not always that simple to explain your ideas in words
There is currently so many other things i have to do before i putt more effort in to the floors and ceilings
Working on some door code and also have to add some things to shoot at

Ps....
I also started to play my good old dune for the psx today
Have to take some breaks for retro gaming also



But i hate that they replaced the 2d grafix with poor 3d ones on the psx/ps one
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 9th May 2011 16:21
Woo. Nice game . It would even run on my PSP .

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th May 2011 23:40 Edited at: 15th May 2011 23:46
There is a reason iam so silent lately

Have bin fooling around with alot of various solutions on doing floor and ceiling textures!

This is my latest test ! and if i only can make it aligne to the darn walls

Iam currently forced to make the floor so freaking lowres that it looks weird when moving!

And it still neads to paste an sprite 4800 times per loop

Maybe i have to scrapp this one to?

The current version draws dummy lines in front of the player that i raycast to get an world position.
Then do i convert it to an grid and then find the position inside that grid to get the right sprite frame.
I will try to put upp an snippet of the floor code if anyone wants it?
Cheers!
Ps..
Big thanks to mint sandcastles for his great ideas on doing this.

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 15th May 2011 23:49
!

Atleat an update ! Well, nice update here! Too bad you gain 18 FPS(?).

PS. Every code snippet is welcome .

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th May 2011 00:02 Edited at: 16th May 2011 00:15
Quote: "Atleat an update ! Well, nice update here! Too bad you gain 18 FPS(?)."

Dbp dosent like that the engine pastes over 6000 sprites every loop

around 5 depth layers of walls and around 4800 times only for the floor

But i havent optimized the floor code at all and finished the first tests right before i posted this

Quote: "PS. Every code snippet is welcome "

I will try to clean it up first and then post it here
Even if i cant use it in this so could it be used for something else?

I could probably use 4800 sprites instead of pasting it and see wath happens?
The raycasting is extremely fast and its the paste sprite command that is slow

Edited....
Remembered that i started to paste the sprites as it started to be many sprites to handle every loop before.
Will look some more on this next week!

I also have som bugg crunching to do!
The floor looks a bit bent in some angles?
Could have to do with the low floor res?

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th May 2011 21:48 Edited at: 16th May 2011 21:49
Quote: "Well, nice update here! Too bad you gain 18 FPS(?)."

Started some more experiments today
I whas extremely suprised! when i noticed that the ordinary 2d box command is so much faster then the paste sprite command?
Iam really baffled here as the box command have always bin slower before?
And i draw the floor with a bunch of box shaped sprites
Now do i then only nead to make an function to get the textures colours at the right places
And fully test this

I cant help to be so suprised over the speed gain by only using the box command to draw the floor?
I havent started to optimize the floor code yet
I love this project as i learn so much new things every day with it!
I included an screenie of when i first tested to draw the floor with the box command!

Attachments

Login to view attachments
kamac
13
Years of Service
User Offline
Joined: 30th Nov 2010
Location: Poland
Posted: 16th May 2011 21:54
Now i'll make you angry !



~~~~ You still have to add the "second" floor which is the top ! Again loosal on FPS .


What's that white floor for ?

Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 16th May 2011 22:15 Edited at: 16th May 2011 22:17
May i suggest you should decrease the angle we see the floor/ceiling at... You would need to do less and therefore gain speed.

I kinda don't remember the floor and ceiling took up this much of the screen in the early games.

And a design view of point from me: i would rather see some nice ceilingless type of game with nice starry / cloudy / whatever backdrop scrolling as you go, and the walls would end upwards using some nice alphablended artcy way. (Alphablending i mean how you did the windows. Look at a few pictures here of Soulhunter how he did the forest/sky blending, i'm thinking of something like that..)

I'm not claustrophobic at all though i have a tendency to hate those so closed games, especially in this Wolfenstein3D style.

What the hell there was a fog kinda thingy built in, or not? Where is it now?

-In.Dev.X: A unique heavy story based shoot'em ~25%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th May 2011 22:21 Edited at: 16th May 2011 22:35
Quote: "What's that white floor for ?"

I only tested the box command before i wrote an function to store the texture colours
I included a screenie with the finished function that stores the colours.
No speed drop with that one at least!
Quote: "~~~~ You still have to add the "second" floor which is the top ! Again loosal on FPS ."

I will work on it to! to somehow be able to have both ceiling and floor textures and still have some usefull framerate.

But its still an huge progess compared to not having an floor texture at all

Give me this week so will we see if i can use this method?

I also found an bugg in my function where i find the coord inside the grid tile?
One coord is misplaced somehow?
I only use an 64X64 texture for the entire floor



Quote: "May i suggest you should decrease the angle we see the floor/ceiling at... You would need to do less and therefore gain speed.

I kinda don't remember the floor and ceiling took up this much of the screen in the early games."

Its simply because its completely off scale and have no diffuse effect yet!
All the pixels i draw the floor with is 4x4 in size and its not supposed to be like that!
Only easier to debugg the code when you see more of it
Quote: "And a design view of point from me: i would rather see some nice ceilingless type of game with nice starry / cloudy / whatever backdrop scrolling as you go, and the walls would end upwards using some nice alphablended artcy way. (Alphablending i mean how you did the windows. Look at a few pictures here of Soulhunter how he did the forest/sky blending, i'm thinking of something like that..)"

Its actually one solution that you could use for some games!
As its extremely simple to only srcoll an large texture for the sky when you turn
Its more or less up to the ones that use the code later on wath they do with it?
I only provide the tool to get them started

Quote: "What the hell there was a fog kinda thingy built in, or not? Where is it now?"

Easier to debug the floor when i can look at everything the whole way.
Its still all there ! only disabled for the moment

One note is also that this floor and ceiling code will allow the player to look upp and down in real time while they move!
You only have to adjust the floors and ceilings starting point according to the view angle!
Only have to figure it out how to do the same with the walls correctly?
But thats an later feature i will add fully!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-05-05 22:40:20
Your offset time is: 2024-05-05 22:40:20