Raycasting Example Source

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

Re: Raycasting Example Source

Postby Hblade » Thu Mar 13, 2008 3:30 pm

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.
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 180 Give a positive score

Re: Raycasting Example Source

Postby skyler » Thu Mar 27, 2008 10:21 pm

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
Image
Wudup Braaaa
User avatar
skyler
 
Posts: 11
Joined: Wed Mar 05, 2008 3:05 am
Location: somewhere, smokin a joint
Score: 0 Give a positive score

Re: Raycasting Example Source

Postby kirby » Sun Mar 30, 2008 5:41 am

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:
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Raycasting Example Source

Postby Fuzzy » Sun Mar 30, 2008 9:10 am

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.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Re: Raycasting Example Source

Postby kirby » Sun Mar 30, 2008 12:01 pm

:oops:
kirby
 
Posts: 121
Joined: Wed Nov 14, 2007 3:32 am
Score: 6 Give a positive score

Re: Raycasting Example Source

Postby feral » Sat Aug 09, 2008 8:44 am

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 314 times
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: Raycasting Example Source

Postby BloodRedDragon » Sun Jun 28, 2009 3:19 pm

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.
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Re: Raycasting Example Source

Postby skydereign » Sun Jun 28, 2009 8:28 pm

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.
User avatar
skydereign
 
Posts: 3513
Joined: Mon Jul 28, 2008 8:29 am
Score: 588 Give a positive score

Re: Raycasting Example Source

Postby BloodRedDragon » Mon Jun 29, 2009 7:04 pm

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.
Current projects:
Techno-Tank Arena: on hold
Techno-Tank SuperPortal (working title): 0.1%
Bowels of Galaxies: 35% (was a bit too optimistic)
User avatar
BloodRedDragon
 
Posts: 123
Joined: Tue Jan 29, 2008 10:07 pm
Location: The Underworld
Score: 5 Give a positive score

Re:

Postby knucklecrunchgames » Mon Feb 18, 2013 7:30 pm

makslane wrote:Just open the ged file and go to the game mode.
Don't works?


how did you do this?
User avatar
knucklecrunchgames
 
Posts: 1124
Joined: Wed Nov 21, 2012 8:01 pm
Location: In gameEditor.exe
Score: 17 Give a positive score

Re: Raycasting Example Source

Postby knucklecrunchgames » Tue Feb 19, 2013 9:31 pm

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:
User avatar
knucklecrunchgames
 
Posts: 1124
Joined: Wed Nov 21, 2012 8:01 pm
Location: In gameEditor.exe
Score: 17 Give a positive score

Re: Raycasting Example Source

Postby lcl » Wed Feb 20, 2013 5:09 pm

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)
SABRE (semi-3D engine) official development topic: viewtopic.php?f=6&t=12644
A game project that utilizes SABRE: viewtopic.php?f=4&t=13297
User avatar
lcl
 
Posts: 2241
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 265 Give a positive score

Re: Raycasting Example Source

Postby knucklecrunchgames » Wed Feb 20, 2013 7:57 pm

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
User avatar
knucklecrunchgames
 
Posts: 1124
Joined: Wed Nov 21, 2012 8:01 pm
Location: In gameEditor.exe
Score: 17 Give a positive score

Re: Raycasting Example Source

Postby Hblade » Fri Feb 22, 2013 7:20 pm

Guys go check out LCL's version
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 180 Give a positive score

Re:

Postby raylen » Tue Apr 01, 2014 11:18 am

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
User avatar
raylen
 
Posts: 12
Joined: Thu Mar 13, 2014 7:27 pm
Score: 1 Give a positive score

PreviousNext

Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest

cron