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.

AppGameKit/AppGameKit Studio Showcase / Wip : Agk raycast engine ( Something like wolfenstein )

Author
Message
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 9th Nov 2011 18:58 Edited at: 9th Nov 2011 19:05
<edit,nm>


Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 10th Nov 2011 12:05
Just make the damn floor a different color already, gonna make a big difference.

Isn't there a triangle / polygon drawing command in AppGameKit you could use instead of sprites? If it is really the king of 2d as they say it should have them.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Nov 2011 12:53
Quote: "Isn't there a triangle / polygon drawing command in AppGameKit you could use instead of sprites?"

Nope. not yet.

My signature is NOT a moderator plaything! Stop changing it!
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 10th Nov 2011 13:20 Edited at: 10th Nov 2011 13:26
Quote: "Isn't there a triangle / polygon drawing command in AppGameKit you could use instead of sprites? If it is really the king of 2d as they say it should have them."


Even so, it would be difficult/impossible to add shading later.

I hope you don't mind, but I've published your work so far on my server: http://darkbit.devstorm.co.uk/redmine/projects/raycast-pseudo3d

SVN access is here, so you can use tortoisesvn or whatever client: http://darkbit.devstorm.co.uk/redmine/svn/raycast-pseudo3d

If you want to use it yourself feel free to create an account and I'll give you full access to do with it what you want.

I'm using it just so I can track your changes easier.


Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Nov 2011 13:54
Quote: "I hope you don't mind, but I've published your work so far on my server:"


No thats ok


its ok with me that you track it there
I have so little time and are lazy enough to post my updates here right now.

I used tortoise for my java updates and more or less stopped using it after that.

For me so is it simplier to post updates in this thread right now.

But i will put your links on the first page and write that you are managing them

Time to get back to the sprite engine
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Nov 2011 16:45 Edited at: 10th Nov 2011 16:46
First progress report on the sprite engine

The map have one ceiling lamp that is scaled and positions correctly on screen.

I never thought it would be this tough to get it working

I only have to write the sprite engine to be able to display more sprites also and fix some weird buggs.
They shake a bit when moving towards them in some angles?
And havent added fading to them.
I havent added the depth buffer also that you can see on the image.


And jerico i hope you understand wath i mean with that iam to lazy to update an svn?
Iam always so tired nowdays after my promotion at work that i hardly have the energy to work on my code projects
So iam always trying to keep everything simple

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Nov 2011 17:16 Edited at: 10th Nov 2011 17:18
Why write an own depth buffer when agk have its own

SetSpriteDepth(nr,10000-height)

Then whas that solved also

If anyone that have checked the code could give me some pointers on how to do things better?
I havent got that much feedback on how to improve my basic code?

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 10th Nov 2011 17:24
Getting better every day! I like!

My signature is NOT a moderator plaything! Stop changing it!
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 10th Nov 2011 17:54
Probably because you are the only one capable of reading your code, haha were way to convoluted and complex for me to get a grip on...

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Nov 2011 18:39 Edited at: 10th Nov 2011 18:40
Quote: "Getting better every day! I like!"

Thanks
Things i like to read to keep me motivated

Quote: "Probably because you are the only one capable of reading your code, haha were way to convoluted and complex for me to get a grip on..."

Its actually very simple
It only looks like an mess

All world cordinates originate in integers.

And when you move the player and cast rays from him so do you use floats.

Like this.

x=10
y=10
Player moves 0.1
x=10.1
y=10.1

The rays always move in floats but are always checked towards an grid cordinate that is an integer.
X#=2.85
y#=2.85
convert them to integers to see if they collide with an wall.
x=x#
y=y#
This is map[3,3] array position on our map.
I throw alot of integers and floats together to get an 3d illusion if you check the code

I will try to write more remstatements with helping text in the coming releases.
But you should remember that iam an trial and error coder that sucks at math

Most of the time so do i write,rewrite and rewrite untill something works ,and dont see my self as a to good programmer.
More like an donkey that dont give up lol.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 10th Nov 2011 19:54
Quote: "And jerico i hope you understand wath i mean with that iam to lazy to update an svn?"


Haha, I think it makes things a little less complicated. I right click and upload my changes, it means i've got the code backed up, and the I can use the diff tool built in to check back on old code which I tend to do a lot.

It allows me to also do dev on multiple machines with very little extra effort. So I like it, but it does take a lot of getting used to at first!


Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Nov 2011 22:19 Edited at: 10th Nov 2011 23:35
The basic sprite engine is done!

Current version supports 20 sprites on screen at the same time but can easially be upgraded

I only have to see how it works with moving enemys later on?

Time to optimize the mess i have done

I also have to fix the rough culling system on them as they vanish slightly before they go off screen.

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Nov 2011 23:53 Edited at: 11th Nov 2011 00:00
Uploading the latest mess

Dont look at the source file this time

Iam going to clean it up later this week.

This is only for them who wants to see the progress of the sprite engine.

I know that they shake a bit when moving and are working on it.
Also know about the rough culling as they get hidden to soon and are working on it.

This project is an rough prototype for something better later on

You can still go out of bounds and crash it so check the minimap where you are!

Attachments

Login to view attachments
3d point in space
15
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 11th Nov 2011 16:10 Edited at: 11th Nov 2011 16:31
Nice work, I been too busy to think about ray casting. I looked at your code and, it is small at the first of the post. Enemies and path finding won't be to hard if you treat the position of the players as a 2d. Any way I think that the floor and ceiling can be another array. So you would have such arrays like this.


and the same thing with the floor.


The enemy's floor plan can also be put in an array.

Go through yourself at a wall.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 11th Nov 2011 16:43
Quote: "Nice work, I been too busy to think about ray casting. I looked at your code and, it is small at the first of the post. Enemies and path finding won't be to hard if you treat the position of the players as a 2d. Any way I think that the floor and ceiling can be another array. So you would have such arrays like this."


The trick is to treat everything as 2d and then simply give the illusion of 3d.
The ai will be simple tile based pathfinding.
You dont nead an array for the floor an ceiling in the first build.
Only later when i want differrent heights on them.

If you want the latest source code so always check for the zipped files.

Or jericos svn.

Thanks for the input.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 13th Nov 2011 17:32 Edited at: 13th Nov 2011 17:33
Started working on the floor rendering again
I think iam a step closer then before now ?
Its only one of the grid cordinates that is screwed right now.
Thats why the darker line is angled when its supposed to be straight
Iam currently writing an completely new raycaster for the floor so its easier to find the problems.
Its only an 32x32 texture as iam experimenting!

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 13th Nov 2011 22:56 Edited at: 13th Nov 2011 22:56
Oohh yes finally there
It runs slow as hell and is not synced to the walls yet.

But it displays the floor texture correctly

Time to clean up the mess also!

Here is the messed upp magic
Nead to speed it upp alot.
But maybe this is usefull for the walls?
Its faster then the method i use for walls?



Attachments

Login to view attachments
Sinistar99_2
13
Years of Service
User Offline
Joined: 5th Dec 2010
Location:
Posted: 14th Nov 2011 01:14
Holy Smack! Wow.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th Nov 2011 00:09 Edited at: 15th Nov 2011 00:11
Quote: "Holy Smack! Wow. "

But i think the version that alignes to the walls looks alot better

Now do i only nead to crunch it down so it dosent use 20 000 sprites

But the hardest parts have bin solved

The fun part is that you can almost not notice that the floor texture is only 32x32 in size?

Attachments

Login to view attachments
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Nov 2011 02:54 Edited at: 15th Nov 2011 02:54
Hey Cliff, sorry I didn't write that code for you when I said; I got tied up in applying for a coding job that I didn't want to screw up.

I've just been writing a proper raycasting engine using vector maths now and here's the first result:


I will perfect it a bit more and let you see the code. - The main upside being the arbitrary angles of walls and the speed gain in using vector maths over iterative raycasting.

Attachments

Login to view attachments
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 15th Nov 2011 04:02 Edited at: 15th Nov 2011 04:02
Ah just thought I'd show you the speed increase in using vectors:


Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th Nov 2011 17:15 Edited at: 15th Nov 2011 17:45
Quote: "I've just been writing a proper raycasting engine using vector maths now and here's the first result:


I will perfect it a bit more and let you see the code. - The main upside being the arbitrary angles of walls and the speed gain in using vector maths over iterative raycasting.

"

But is this not the same as my old linecaster engine?
http://forum.thegamecreators.com/?m=forum_view&b=8&t=182724&p=0



The problem with linecast/vector line renderers is that it is complicated to write editors for .
You spend most of your time writting the editor then the game or engine.
And it neads bsp trees and raycast zones for large maps.
And you nead to check all of the map lines in your raycasters every loop if you dont.

Iam keeping it simple and have the goal for an grid based raycaster like the game fears on amiga first.



It looked like this first



And then improve it.

And if you check the snippet of my current floor renderer so do you see that i use linecast/vector lines for it.

And are working on something similar for the walls that will increase its speed alot.

But all input is good input

Edited.............
I forgott to mention that iam working on this as an modular engine where every part is scalable to make it work on most devices.
And thats also why iam keeping it to an grid based raycaster
You know cowbox that i like all your input about improving it
Why dont you buy agk so we can work on this together?

Included an screenie of my floor with only 32 rays instead of 210
And it still alignes perfectly and scrolls as it should.
Only a bit more pixelated

Attachments

Login to view attachments
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 15th Nov 2011 20:21
Wow that looks awsome! I wish I knew how to do that

Srry about my english im from sweeden
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th Nov 2011 21:00 Edited at: 15th Nov 2011 21:12
Quote: "Wow that looks awsome! I wish I knew how to do that "

You can always learn as iam releasing all the source on this project.
Only problem is that iam a messy coder

My source looks like someone put it inside an blender

I hope someone helps me out later to make it cleaner so that others can read and learn from it .

Could someone suggest how an clean and proper code should look like! so will i try to clean it up that way.
I want as many as possible to understand it and not only me!

As parts of the raycaster can be used for many things,like the floor caster can be use for mario kart or racing games on the agk.

Here is an screenie of my latest mess and is still not optimized yet.

The floor and ceiling uses an 64x64 texture now,and i tryed to cut down the sprites used by skipping some lines of sprites.

Hopefully can i skip this lowres floor and ceiling when i optimizes the rest

There is also no culling at all on the floor or ceiling,it constantly draws the floor even if the view is blocked.

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 15th Nov 2011 21:32
Quote: "As parts of the raycaster can be used for many things,like the floor caster can be use for mario kart or racing games on the agk."

I so want to do that!

My signature is NOT a moderator plaything! Stop changing it!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th Nov 2011 21:38 Edited at: 15th Nov 2011 21:39
Quote: "I so want to do that!"




I will try to type in wath you nead to only use the floor caster in the next release!

Hopefully by the end of the week

Iam currently trying to collect the various parts in to chapters in the source so that if anyone wants to only use parts.

Simply cut and paste that part in to your project.

The only thing i want is some credit in the credits list
I dont care if you earn a billion on your game
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 15th Nov 2011 23:41
Quote: "You can always learn as iam releasing all the source on this project."


I know, I downloaded the source but sadly im not that experienced with programming to learn so much from it

I can braley see wich part of the code that does the raycasting

Srry about my english im from sweeden
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 15th Nov 2011 23:57
Quote: "I know, I downloaded the source but sadly im not that experienced with programming to learn so much from it

I can braley see wich part of the code that does the raycasting "

The current aviable source is a mess!
I gets like that when prototyping an idea

The next release will be alot easier to follow and to see waths doing wath .

And iam adding alot of helping rem statements

Check back later this week and give it a try again
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 16th Nov 2011 02:07
Please enable skybox support into it as well, with a good skybox you can really do some amazing things, and make something that's simple, something quite special.

Here is also an idea I had, I'm not sure if its possible though, having a player being able to walk up and down the walls and ceiling, not just the floor, so its as if the idea of a floor it mute, because the floor, or your 'perspective' of the floor, can be any of the surfaces.


Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th Nov 2011 17:31
Quote: "Please enable skybox support into it as well, with a good skybox you can really do some amazing things, and make something that's simple, something quite special."

That should be really simple?
As i could simply scroll an large cloud background to give the illusion of an sky box.

Quote: "Here is also an idea I had, I'm not sure if its possible though, having a player being able to walk up and down the walls and ceiling, not just the floor, so its as if the idea of a floor it mute, because the floor, or your 'perspective' of the floor, can be any of the surfaces."

Thats pretty advanced
Iam not sure i can pull it off ?

First do i want stair cases and various floor heights
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 16th Nov 2011 17:49 Edited at: 16th Nov 2011 17:53
Quote: "As i could simply scroll an large cloud background to give the illusion of an sky box."

Thats good, but having an option for a proper cube skybox is even better. The levels in my solar cycle game are simple, its the skybox that gives all the theme to the level.



A little goes a long way. (how about doing both ideas)


Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th Nov 2011 20:22
Quote: "Thats good, but having an option for a proper cube skybox is even better. The levels in my solar cycle game are simple, its the skybox that gives all the theme to the level."

If i succed with doing multiple floors so is it actually possible with an fake cube skybox.
Simply draw very high walls around the map with floor and ceiling on it
And the texture it with an sky box texture.

But it would use a billion sprites

But iam hard at work with a couple of levels of adjustments to the floor and ceiling renderer.

You can now adjust the step in front of the raycaster where it casts it rays.
As there position is calculated by its distance to where its placed on screen so do you get an low or high res option automaticly.
And i have already written the code that stretches the floor sprite to always aligne to the one above or in under.
So if you have an high number so can you have an floor that stretches very far but are pixelated with a few sprites.
Or with an low number that is very detailed but dont draws so far.

Quote: "A little goes a long way. (how about doing both ideas)"

I will try but dont know if i have the skills for it

But back to work now :
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 17th Nov 2011 20:46
I think I'll wait for Lee to add real 3D capabilities to AGK.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Quel
15
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 17th Nov 2011 21:53
Seven and a half FPS on what kind of device?

Whatever it is running on, very nice, good to see you have finally achieved the desired look, now you just need to find the acceptable balance between performance and visuals.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-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: 17th Nov 2011 22:46
Quote: " I think I'll wait for Lee to add real 3D capabilities to AGK."

Would be alot easier

Quote: "Seven and a half FPS on what kind of device?"

actually 20-30 fps but still not good enough.
I have an netbook with 2 ghz dual core with an intel gfx card.

Its pretty much the usage of over 20 000 sprites on screen that chookes it.
But still pretty impressive by agk as they are constantly shifted and changing frames ect.
And if i use less so does the floor look like crapp.

This is pretty much for fun and if it works who knows?

But the more i read about raycasting so do i seam to find an mayor problem!

Most engines and raycaster tutorials have an screen resolution of 320x240 or less?
I use an 640x480 resolution that forces you to use alot more sprites to draw the floor ect.

Most smart phones have an screen resolution of 320x240.

But iam still learning



No one that have an good idea of waths wrong with this code?
This is wath i use to get the sprite frame from its position inside the world grid.
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 18th Nov 2011 08:49
I think the physical limit of sprites displayed is 16384, unless they changed this.

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
bitJericho
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location: United States
Posted: 18th Nov 2011 10:33 Edited at: 18th Nov 2011 10:34
what if you use sprites for the floor that stretch from the left to the right side of the screen?

Er... nm, that wouldn't work for changing floor heights.


Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 18th Nov 2011 15:42 Edited at: 18th Nov 2011 15:43
Quote: "I think the physical limit of sprites displayed is 16384, unless they changed this."

I dont know about that ? but agk registers over 20 000 sprites and i use 20 000 only for the floor.

And i dont see anything missing on screen .

But i dont use that many now and found a way to shrink that amount!

But if its right so could it be one of the problems i have had with it?



Quote: "what if you use sprites for the floor that stretch from the left to the right side of the screen?

Er... nm, that wouldn't work for changing floor heights."

Its very small sprites that is placed on screen according to the floor pixel world cordinate.
This uses distance to player,world position and wath height you have given that grid position.
You should see each map grid as an cube that you can move upp and down.
Hope that explains it

Its the same as most raycast engines use , but doom uses something differrent for floor and walls.
Alot more complicated.
If you dont use to chunky floor pixels so will it look right

But to early to start working on heights with all the other problems

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 18th Nov 2011 21:02 Edited at: 18th Nov 2011 21:03
Quote: "Er... nm, that wouldn't work for changing floor heights."


I only wanted to show you an sample of wath i whas talking about

Her did i simply tell the raycaster that the floor is 40 pixels higher then the default height.

Its completely wrong as its supposed to be reversed with highest point closest to the player.

And it dosent have any sides and stretches the nearest floor pixel to compensate because of it.

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 18th Nov 2011 22:09 Edited at: 18th Nov 2011 22:10
Quote: "what if you use sprites for the floor that stretch from the left to the right side of the screen?

Er... nm, that wouldn't work for changing floor heights."

Solved the weird height problem
So simple when you only nead to divide the distance and then increase the height with (divided distance)*your height value.
But also notice how freaking off my floor texturer is
I also changed the texture to one that shows the height more

And also found the conclusion that i probably nead to rewrite most of the raycaster to get this to work properly
Sorry for the double posts.

Attachments

Login to view attachments
The Zoq2
15
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 18th Nov 2011 22:31
Quote: "rewrite most of the raycaster"


That sounds bad...
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 18th Nov 2011 23:51 Edited at: 18th Nov 2011 23:52
Quote: "That sounds bad..."

Its alot of work.
But iam thinking of making this one first as i have some thoughts on how to rewrite parts of this?

But if i keep this one so will it be limited to 3 floors.
I will give it a go this weekend and if it dosent work so is it back to the drawing board

I rewrote parts of the floor renderer to detect heights better at least.
But this gives new problems also.

Attachments

Login to view attachments
C0wbox
18
Years of Service
User Offline
Joined: 6th Jun 2006
Location: 0,50,-150
Posted: 19th Nov 2011 02:04 Edited at: 19th Nov 2011 02:50
Wow, how are you doing the floors so well - I just figured out how to get mine 95% working, but you can raise yours. D:

Are you going to be posting the code for the engine any time soon? - I really want to see how you're handling floor and ceiling rendering so elegantly.


My engine can normally achieve over 500FPS with just walls but as soon as I render floors (even on fairly low detail) the FPS drops significantly, even to the point where if you look directly down it falls below the cap (66).

EDIT:
Ah I just optimized the code and made it so it isn't rendering the floor segments as often as the wall segments and voila - it's back to being fast again. ! - Your pictures inspired me to change the code to do this, so you take full credit for my breakthrough. xD

Attachments

Login to view attachments
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 19th Nov 2011 10:01 Edited at: 19th Nov 2011 14:40
Quote: "Wow, how are you doing the floors so well - I just figured out how to get mine 95% working, but you can raise yours. D:

Are you going to be posting the code for the engine any time soon? - I really want to see how you're handling floor and ceiling rendering so elegantly."

I dropped the linecast method as its extremely slow compared to an moving cordinate that gets the pixel data.

This is the current mess that still is in progress and it textures the tile wrong.
The texture is not centered.





It have alot of stuff remed out as its an prototype

And i noticed that this whas wrong after posting
SetSpriteAnimation ( id , 1 , 1 , 64*64 )
Should be 32*32 as its the texture size.

Edited...........
Starting to get it right with the floor ceiling texturer i belive?
Only problem is that it steals pixel on the edges

Attachments

Login to view attachments
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 19th Nov 2011 21:31
Hi Cliff,
Just curious, could this engine be useful for a voxel terrain engine?
BTW very good work!

Regards!
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 19th Nov 2011 23:28 Edited at: 19th Nov 2011 23:41
Quote: "Hi Cliff,
Just curious, could this engine be useful for a voxel terrain engine?
BTW very good work!

Regards! "

The floor is more or less an voxel engine
Iam having a hard time getting it to not behave like it and be squared
The main task if you are going to use it like an voxel engine is to do the mapper
You nead to assign an height to each pixel.

You should be able to create an project and add the above code snippet and start experimenting .
Simply add an random height generator and se wath happens.
Should behave like water if you put it inside the function.

I could put upp the latest changes but they are more away from the voxel aspect as iam doing walls insid it now!
Have banged my head against the wall all day with this

But here is 3 cubes on differrent heights and i know its very lowres
I made the cube walls transparent so its easier for me to see various buggs.
Iam trying to do something like the fears game engine on amiga




Edited.............
Started thinking
But know when i have solved the task to render cubes with all sides using sprites.

So should it be easier to draw corridors and rooms like fps creator instead?
The player walks inside the cubes the raycaster generates.

i must test if its possible

Attachments

Login to view attachments
BraindeaD
16
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 20th Nov 2011 11:21
Quote: "The floor is more or less an voxel engine
Iam having a hard time getting it to not behave like it and be squared
The main task if you are going to use it like an voxel engine is to do the mapper
You nead to assign an height to each pixel.

You should be able to create an project and add the above code snippet and start experimenting .
Simply add an random height generator and se wath happens.
Should behave like water if you put it inside the function.
"


Thanks Cliff,
I'll try to make something like voxel, as soon I get some free time, using your engine... it will be my first approach to voxels so don't expect something usable...
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 20th Nov 2011 13:37
Quote: "Thanks Cliff,
I'll try to make something like voxel, as soon I get some free time, using your engine... it will be my first approach to voxels so don't expect something usable... "

The experimentation is one of the biggest parts of fun in programming

This is for fun for me and always nice to see things happen when you understand it some more
fallen one
18
Years of Service
User Offline
Joined: 7th Aug 2006
Location: My imagination!
Posted: 20th Nov 2011 18:30
It would be good if the editor could load a greyscale image and use it as a height map to create the map. Perhaps even have the ability to use a heightmap doubled up as well, use one for the bottom section of the map, and one for the top section, that would allow sculpting rooms with different walls ceilings and upper wall sections.


Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 21st Nov 2011 19:07 Edited at: 21st Nov 2011 21:57
Ok!
Iam totally stuck on getting the floor an ceiling angles right when the player moves upp and down
So started working on something else to not get an brain meltdown.
Started on the floor culling as we dont nead to draw floors and ceilings if an wall is blocking it from the player eye anyway.
Also completely culls all rays if outside the map.
Have an framerate that goes from 30 to 200 now.
And thats a good start as its with an detailed floor texture.
But also noticed that i nead to add an adjustment value to the floor texture.


Quote: "It would be good if the editor could load a greyscale image and use it as a height map to create the map. Perhaps even have the ability to use a heightmap doubled up as well, use one for the bottom section of the map, and one for the top section, that would allow sculpting rooms with different walls ceilings and upper wall sections."

I dont think agk kan get pixel colors?
Or i have totally missed this command?
A great idea but think its a bit to complicated to code for an noob like me
But keep on throwing me ideas
Who know if i use them when i get more talented with agk



Ok!
I have made 2 versions now of the get pixel function.

They explain them self!

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-23 15:02:57
Your offset time is: 2024-11-23 15:02:57