Page 3 of 4

Re: Raycasting Example Source

PostPosted: Thu Mar 13, 2008 3:30 pm
by Hblade
I got it, just have the program read in small sectors, instead of the whole thing being read at once. That will help allot with the lag.

Re: Raycasting Example Source

PostPosted: Thu Mar 27, 2008 10:21 pm
by skyler
awsome you could make like a 3d shooter out of that put a gun in front of view and some monsters = fun shooting games :D

Re: Raycasting Example Source

PostPosted: Sun Mar 30, 2008 5:41 am
by kirby
Wowww, if that happens, that would be..... popularity? There's someone said the ged cannot, CANNOT, CCAAAANNNNNOOOOOTTTTT make 3D games... But somehow it can. Now thats too much awsome. :P :oops: :P :oops: :P :oops: :D :) :( :) :D :shock:

Re: Raycasting Example Source

PostPosted: Sun Mar 30, 2008 9:10 am
by Fuzzy
No, they simply dont want people slagging GE cause they cannot make their dream 3D game. And we dont want people asking a million questions about how to do it.

There were lots of 3D games before graphics cards had 3D capabilities. They were done much like this.

Re: Raycasting Example Source

PostPosted: Sun Mar 30, 2008 12:01 pm
by kirby
:oops:

Re: Raycasting Example Source

PostPosted: Sat Aug 09, 2008 8:44 am
by feral
I have tried optimizing the code for this...

I found a few unnecessary declarations, and some code inside "if loops" that got repeated every loop and were not needed in there...

I also declared some of the constant values as #defines so the variable lookups was not needed, and remove the cos/sin lookups from the keydown events, unfortunately this resulted in very little performance increase..

The main bottle neck is ( as most of you know) the draw pixel routine, which runs at least about 3000 times every screen redraw ( and sometimes a LOT more..)

so in the end I replaced the textures with simple line draw routines, and achieved "a very plain and ordinary", but playable game engine..(for GE)

it is not half as pretty as the original version...but, it is possibly now usable if anyone wants to experiment with 3D..

note: This is NOT my work, I simply played with the original code...It is still only a walk through - no enemies, no guns, or anything... just modified code for others to build on if they wish.


gefoxSG.jpg

gefox2.zip
ged and data files
(38.51 KiB) Downloaded 519 times

Re: Raycasting Example Source

PostPosted: Sun Jun 28, 2009 3:19 pm
by BloodRedDragon
This is great! It shows the true potential of GE even if its a bit slow :(. Mind if I use it in a game? I will give credit + lots of points.

Re: Raycasting Example Source

PostPosted: Sun Jun 28, 2009 8:28 pm
by skydereign
If you are talking about feral's version, it is not as slow as it may seem. The framerate is reduced to 16, I increased it to 30 and higher, and it was a lot faster. Or you can go into global code and edit the #define values, that way it is faster, though increasing the framerate should be done first.

Re: Raycasting Example Source

PostPosted: Mon Jun 29, 2009 7:04 pm
by BloodRedDragon
Yeah i soon discovered that the frame rate was only 16. and that if you change the resolution to half the size it is also a lot faster. But it is good to have the right balance. Personally I prefer games that have a great frame rate instead of over-done graphic detail or screen size. I dont know why but it feels more lifelike that way.

Re:

PostPosted: Mon Feb 18, 2013 7:30 pm
by knucklecrunchgames
makslane wrote:Just open the ged file and go to the game mode.
Don't works?


how did you do this?

Re: Raycasting Example Source

PostPosted: Tue Feb 19, 2013 9:31 pm
by knucklecrunchgames
This is awesome.
If makslane could get GE running it faster. then we would beat Game maker in no time (oops sorry mentioned you- know- what) :oops:

Re: Raycasting Example Source

PostPosted: Wed Feb 20, 2013 5:09 pm
by lcl
knucklecrunchgames wrote:This is awesome.
If makslane could get GE running it faster. then we would beat Game maker in no time (oops sorry mentioned you- know- what) :oops:

I think that it is not important to get GE run this kind of code faster. It is clear that setpen() and putpixel() are very demanding functions to be used in amounts as great as in this example.
What IS important, is to search for alternative ways to achieve the same effect in ways that GE supports better. For example, this demo uses drawing functions which are not GE's strength.

I have been working on this demo's code and have transformed it to use draw_from() to draw the textures from single actor that changes animations and frames continuously.
This way, the program will only need 1 call of a drawing function for drawing a whole vertical line. So, where in this demo it was possible that the program had to draw 307 200 pixels (640 * 480 = 307 200,
if you are standing in front of a wall so that it covers the whole screen), one by one, which means 307 200 setpen() calls AND 307 200 putpixel() calls,
with my editions it would only need to call draw_from() max. 640 times (one for each vertical line).

I am going to publish my edited version of gefox soon, I just want to make it a little more user friendly and to write some documentation about it.

Got a little carried away talking about my editions to this.. sorry :o

But what I was trying to say to you, kcg, was that when you find out that GE doesn't have enough power to do something you want it to do,
instead of complaining about it in hopes of someone making GE do what you want, you could just try to find another way to make it work. :D
(Well, that was one LONG sentence :lol: I hope it doesn't make it difficult to understand what I'm trying to say. :D)

Re: Raycasting Example Source

PostPosted: Wed Feb 20, 2013 7:57 pm
by knucklecrunchgames
lcl wrote:
knucklecrunchgames wrote:This is awesome.
If makslane could get GE running it faster. then we would beat Game maker in no time (oops sorry mentioned you- know- what) :oops:

I think that it is not important to get GE run this kind of code faster. It is clear that setpen() and putpixel() are very demanding functions to be used in amounts as great as in this example.
What IS important, is to search for alternative ways to achieve the same effect in ways that GE supports better. For example, this demo uses drawing functions which are not GE's strength.

I have been working on this demo's code and have transformed it to use draw_from() to draw the textures from single actor that changes animations and frames continuously.
This way, the program will only need 1 call of a drawing function for drawing a whole vertical line. So, where in this demo it was possible that the program had to draw 307 200 pixels (640 * 480 = 307 200,
if you are standing in front of a wall so that it covers the whole screen), one by one, which means 307 200 setpen() calls AND 307 200 putpixel() calls,
with my editions it would only need to call draw_from() max. 640 times (one for each vertical line).

I am going to publish my edited version of gefox soon, I just want to make it a little more user friendly and to write some documentation about it.

Got a little carried away talking about my editions to this.. sorry :o

But what I was trying to say to you, kcg, was that when you find out that GE doesn't have enough power to do something you want it to do,
instead of complaining about it in hopes of someone making GE do what you want, you could just try to find another way to make it work. :D
(Well, that was one LONG sentence :lol: I hope it doesn't make it difficult to understand what I'm trying to say. :D)


It's ok I get it

Re: Raycasting Example Source

PostPosted: Fri Feb 22, 2013 7:20 pm
by Hblade
Guys go check out LCL's version

Re:

PostPosted: Tue Apr 01, 2014 11:18 am
by raylen
scythe wrote:Man that looks great, but I cannot get the demo to work, do i need to export it?* I am running on my Vista partition atm, could that be it?

Scythe

* :roll:... noob
click game mode or file>export
-Raylen
fyi- i learned that the first i used ge :D