In the Shadows - rogue-ish prototype (visibility engine)
Moderator: Moderators
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
In the Shadows - rogue-ish prototype (visibility engine)
I did the Ludum Dare 15, and got a completed thing,. but not really a game. see;
http://www.ludumdare.com/compo/ludum-da ... te&uid=848
Currenly there is a problem on Vista but it runs fine on XP ?
As you can see, it is just a begining of game. I had to rush it for the 48 hour challange so there are still lots of code problems,. perhaps you can help.
I am reading about Line Of Sight (LOS) and raycasting to see how to improve my crappy hackery,. . the main array should probably be int not float and I will have to re-jig my wall fading,. etc. I will post a cleaned up version soon.
For now check the attachment.
Any suggestions for improvments, on my raycasting,. or any of it, really are welcome,. cheers.
UPDATED; fixed the tune array err..,
http://www.ludumdare.com/compo/ludum-da ... te&uid=848
Currenly there is a problem on Vista but it runs fine on XP ?
As you can see, it is just a begining of game. I had to rush it for the 48 hour challange so there are still lots of code problems,. perhaps you can help.
I am reading about Line Of Sight (LOS) and raycasting to see how to improve my crappy hackery,. . the main array should probably be int not float and I will have to re-jig my wall fading,. etc. I will post a cleaned up version soon.
For now check the attachment.
Any suggestions for improvments, on my raycasting,. or any of it, really are welcome,. cheers.
UPDATED; fixed the tune array err..,
- Attachments
-
- InTheShadows_013b.zip
- the .exe and the .zgeproj
ver.b - (42.4 KiB) Downloaded 932 times
Last edited by jph_wacheski on Tue Sep 01, 2009 9:14 pm, edited 1 time in total.
iterationGAMES.com
Hey,
The project generates a "Array read outside range" error within a couple of seconds over here. To prevent these kind of things from happening I usually write a function that checks whether or not a array read / write is valid before actually performing the task.
When it comes to the occlusion calculations you really want to use a lookup-table. Since you're using a grid based structure for your level data, you can simply sample all of the calculation results that you need.
K
The project generates a "Array read outside range" error within a couple of seconds over here. To prevent these kind of things from happening I usually write a function that checks whether or not a array read / write is valid before actually performing the task.
When it comes to the occlusion calculations you really want to use a lookup-table. Since you're using a grid based structure for your level data, you can simply sample all of the calculation results that you need.
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
Think I fixed that last array error,. or i hope so. must have added the tune part right at the end and not test in the editor, random note was one larger than the array size. I only run there to look for array errors it seems,. . it seems to me that XP will run things that write data outside their defined arrays where vista just refuses,. . interesting. anyone running vist please test this updated .exe file
Not too sure how a look up table will help here,. but I will look into it. It is the fact that you have to decide when you hit somthing and block that ray from lighting further, that seems slowish,. so far the most promising info is coming from over here;
http://roguebasin.roguelikedevelopment. ... tegory:FOV
Like I said I will have a go at cleaning this up soon,. .
Not too sure how a look up table will help here,. but I will look into it. It is the fact that you have to decide when you hit somthing and block that ray from lighting further, that seems slowish,. so far the most promising info is coming from over here;
http://roguebasin.roguelikedevelopment. ... tegory:FOV
Like I said I will have a go at cleaning this up soon,. .
iterationGAMES.com
Hey,
Haven't looked at your occlusion algorithm thoroughly, but if you'd go all out on look-up tables ( not recommended ), you could sample the visibility of each cell within your clipping range for each position of a level. That way all occlusion is calculated once up-front, and can simply be read from the table from thereon.
Anyway, the biggest hog is obviously the fact that you're rendering your entire scene every frame, while nothing / very little changes most of those frames. You only want to render the pixels that changed compared to the last frame .. if nothing has changed, don't render anything.
K
Haven't looked at your occlusion algorithm thoroughly, but if you'd go all out on look-up tables ( not recommended ), you could sample the visibility of each cell within your clipping range for each position of a level. That way all occlusion is calculated once up-front, and can simply be read from the table from thereon.
Anyway, the biggest hog is obviously the fact that you're rendering your entire scene every frame, while nothing / very little changes most of those frames. You only want to render the pixels that changed compared to the last frame .. if nothing has changed, don't render anything.
K
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
hay y offs et, can you try this one please. I converted everything to int where I had floats befor,.
This is apperently not limited to Vista as a buddy running XP has it crashing as well., this a tad disconcerting as the editor throws no errors? In this ver. the walls that are lit up once stay lit, showing what parts of the maze have been seen,. plus I hacked in an aiming mechanic on the LMB,. hold the mouse button to aim (does nothing but test my code). I like the set up so far, however if I can not track down this random crashing I may have to abandon the project,. .
This is apperently not limited to Vista as a buddy running XP has it crashing as well., this a tad disconcerting as the editor throws no errors? In this ver. the walls that are lit up once stay lit, showing what parts of the maze have been seen,. plus I hacked in an aiming mechanic on the LMB,. hold the mouse button to aim (does nothing but test my code). I like the set up so far, however if I can not track down this random crashing I may have to abandon the project,. .
- Attachments
-
- InTheShadows_015.zip
- .exe with the .zgeproj
- (53.14 KiB) Downloaded 877 times
iterationGAMES.com
This is strange. I ran your project inside editor in full debug mode and it reported no errors. This means there are no memory leaks or buffer overwrites of any kind.
To make sure there are not any compression problems please try an uncompressed exe (no upx) and turn off "remove code".
Also download latest beta. I updated it today so that I can be sure we are both using the latest code.
y offs et: please post the access violation message you get. You can copy the text to clipboard using Ctrl+C when the dialog is displayed.
To make sure there are not any compression problems please try an uncompressed exe (no upx) and turn off "remove code".
Also download latest beta. I updated it today so that I can be sure we are both using the latest code.
y offs et: please post the access violation message you get. You can copy the text to clipboard using Ctrl+C when the dialog is displayed.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
ok, got the new beta, I just re-saved the project file and built it uncompressed. I will ask Raigan to try, as it crashed on his XP machine,. and y offs et could you please try this ver. for testing,. thanks for looking into this guys.
i was also reading this one;
http://roguebasin.roguelikedevelopment. ... ias_Downer
and indeed the suggestion is to pre-calculate and store the rays in some form of array,. just not exactly sure how best to try that yet,. its the duplication that slowes it,. , perhaps after a beer I will have an idea. brb
UPDATE; Ragian reports that this still crashes on his XP machine???
i was also reading this one;
http://roguebasin.roguelikedevelopment. ... ias_Downer
and indeed the suggestion is to pre-calculate and store the rays in some form of array,. just not exactly sure how best to try that yet,. its the duplication that slowes it,. , perhaps after a beer I will have an idea. brb
UPDATE; Ragian reports that this still crashes on his XP machine???
- Attachments
-
- InTheShadows_016.zip
- .exe (uncompressed) and current .zgeproj
- (48.34 KiB) Downloaded 846 times
iterationGAMES.com
Jph, can you try to find out what graphics card is used and if there is anything non-standard about the configuration of that computer?
yoffset, it is very hard to debug this problem when I don't have a computer with ATI. The error message comes from inside the ATI-driver unfortunately so it doesn't give me a clue about what in ZGE that causes the problem. The last time we discussed this it seemed to involve the bitmap editor and mipmap-settings. Can you please try the latest beta and create a new bitmap (using cells and blur) and try different settings of the Bitmap.Filter property. Any more info or error messages involving this can be helpful to me, thanks.
yoffset, it is very hard to debug this problem when I don't have a computer with ATI. The error message comes from inside the ATI-driver unfortunately so it doesn't give me a clue about what in ZGE that causes the problem. The last time we discussed this it seemed to involve the bitmap editor and mipmap-settings. Can you please try the latest beta and create a new bitmap (using cells and blur) and try different settings of the Bitmap.Filter property. Any more info or error messages involving this can be helpful to me, thanks.
- jph_wacheski
- Posts: 1005
- Joined: Sat Feb 16, 2008 8:10 pm
- Location: Canada
- Contact:
interesting,. ZGE must allow me to put some value outside an acceptable range that the ati drivers just refuse to accept,. perhaps an alpha verging into undefined areas that other drivers just clamp or round back to a safe useable value,. just my speculation as it is just as some point in this devlopment that the problem arouse. worked fine for a while,. .?
I have been still working on this,. so here is an update for those with non-ati video cards,. added light fall-off effects,. and the ranged attack on the LMB now shows, what will become, a damage falloff aswell,.
Also been tweeking the graphics., and what I would like to do is make a tile-sheet type of setup to make it simple to sub in random wall tiles,. I have not tryed it yet but the only way i can think to do it is to make individual tiles (bitmap components like the current single one) then use an array to write them to a single bitmap in the tile locations,. . this is what I had suggested the bitmapPosition or Translate component for, however this idea may work anyway,. gota run off and do some other work but I should be able to try it later tonight,. .
I have been still working on this,. so here is an update for those with non-ati video cards,. added light fall-off effects,. and the ranged attack on the LMB now shows, what will become, a damage falloff aswell,.
Also been tweeking the graphics., and what I would like to do is make a tile-sheet type of setup to make it simple to sub in random wall tiles,. I have not tryed it yet but the only way i can think to do it is to make individual tiles (bitmap components like the current single one) then use an array to write them to a single bitmap in the tile locations,. . this is what I had suggested the bitmapPosition or Translate component for, however this idea may work anyway,. gota run off and do some other work but I should be able to try it later tonight,. .
- Attachments
-
- InTheShadows_019.zip
- .exe
- (38.83 KiB) Downloaded 860 times
iterationGAMES.com
Just tried version 19, I really like the graphics improvements!
I'd like to know why it's not working on some computers so that we can fix it as soon as possible because it could be a problem inside the zge-engine that affects all zge-generated exe-files.
If it doesn't work on your computer and you want to help then try to start it with sound disabled using the "-s" switch, like this:
"InTheShadows_019.exe -s"
Does it make any difference?
Also please let me know what graphics card you have installed. This will hopefully help me isolate the error so that I can try to build and upload a debug-version to see if any error message is displayed with it.
I'd like to know why it's not working on some computers so that we can fix it as soon as possible because it could be a problem inside the zge-engine that affects all zge-generated exe-files.
If it doesn't work on your computer and you want to help then try to start it with sound disabled using the "-s" switch, like this:
"InTheShadows_019.exe -s"
Does it make any difference?
Also please let me know what graphics card you have installed. This will hopefully help me isolate the error so that I can try to build and upload a debug-version to see if any error message is displayed with it.