My collision script is coming along great, but for some reason it likes to screw up.
[cpp]
// Collision Start
if(x >= (b1x + 45)){
// Nothing
}else if(y >= (b1y + 42)){
// Nothing
}else if(b1x >= (x + 51)){
// Nothing
}else if(b1y >= (y + 80)){
// Nothing
}else {
if((y + 80) > (b1y + 42)){
y += 1;
}else if((y + 80) < (b1y + 42)){
y -= 1;
}else if((x + 51) > (b1x + 45)){
x += 1;
}else if((x + 51) < (b1x + 45)){
x -= 1;
}
}
// Collision End
[/cpp]
When the character tries to run into the box from the top or bottom, he just kind of bumps into it repeatedly. Good. But when he goes through it through the sides he's pushed really fast to the bottom or top depending where he's located. Now I'm sure it might be because it's checking both the Y and X position and will act accordingly, so I must check if the Y coordinates are at a specific number with the X coordinates? :sigh:
[QUOTE=nullsquared;19870685]I think it was about 30 seconds for that render, 2 threads.[/QUOTE]
Ah, is it possible that your renderer basically has no diffuse lightning at all?
Since the top most part of the sphere is completely white, and the background too.
So, I think you just check intersection and then directly calculate the AO value?
[QUOTE=s0ul0r;19870975]Ah, is it possible that your renderer basically has no diffuse lightning at all?
Since the top most part of the sphere is completely white, and the background too.
So, I think you just check intersection and then directly calculate the AO value?[/QUOTE]
Oh yeah that was purely an AO render, nothing else.
Here's a shot with everything, but much less AO samples because of the reflections and what-not:
[img]http://img141.imageshack.us/img141/9872/finalaoshot.png[/img]
(I know there's problems with the texturing)
I like your setup but, you don't have any camera setup do you?
Simply along the z-axis right?
(I mean, that's why the scene looks so perfect aligned :v:)
[QUOTE=s0ul0r;19871130]I like your setup but, you don't have any camera setup do you?
Simply along the z-axis right?
(I mean, that's why the scene looks so perfect aligned :v:)[/QUOTE]
Oh yeah my only camera setup is position based right now, no matrix involvement yet so no rotation :v: (actually you can move with WASD, though depending on the render time that's not too useful :v:)
[QUOTE=nullsquared;19871058]Oh yeah that was purely an AO render, nothing else.
Here's a shot with everything, but much less AO samples because of the reflections and what-not:
[img]http://img141.imageshack.us/img141/9872/finalaoshot.png[/img]
(I know there's problems with the texturing)[/QUOTE]
Holy Christ, that is fucking amazing.
I got the basics on my FRC robot coding and now I just need to teach everyone how to not fuck everything up.
Coding isn't hard at all the problem is managing projects and people... It becomes a real problem when you are running low on time...
I write Code but I can't document it properly because I'm in a rush. So now I have to explain everything. This gives me less time to do my next piece of code therefor bad documentation... And cycle goes on...
I seriously need a caffeine rush and the ability to slow down time... Ohh and A team that ACTUALLY KNOWS HOW TO CODE!
Yep, life is great...
How would I go about making 3Dish rooms ( like doom ) with SDL?
[url]http://en.wikipedia.org/wiki/Graphical_projection[/url]
Basically, you call your 3D world a frustum, and have the screen as the front face of the frustum, with the user as the "point" of it. For each wall, you work out the 3D positions of the corner, and work out where the point appears on the screen, using similar triangles, and a line through the "screen" to the point. You then deform the texture to fit into those co-ordinates.
If you want to include proper perpective, I think you have to include some fancy trig shit, but that would look passable, at least.
Or so I think, I'm not an expert in any way shape, or form: null will probably be able to answer you better.
[QUOTE=The Inzuki;19870973]My collision script is coming along great, but for some reason it likes to screw up.
*code*
When the character tries to run into the box from the top or bottom, he just kind of bumps into it repeatedly. Good. But when he goes through it through the sides he's pushed really fast to the bottom or top depending where he's located. Now I'm sure it might be because it's checking both the Y and X position and will act accordingly, so I must check if the Y coordinates are at a specific number with the X coordinates? :sigh:[/QUOTE]
One method that you could use is to determine which side the player is it, ie Top, Bottom, Left or Right. Depending on which side the player is on, determines the code for 'pushing' him back.
You really shouldn't be pushing the player back. That's asking for trouble.
The movement code should be like Can we move to this new position?
Yes. Put the player there
No. Don't move. (Or more commonly, trace along that direction and move as far as we can move)
[editline]12:50PM[/editline]
Also, your collision code is pretty weird. Here's an example of how to do it nicely.
[cpp] inline bool RectIntersectRect( const Rect& r1, const Rect& r2 )
{
if ( r1.x1 > r2.x2 ) return false;
if ( r1.x2 < r2.x1 ) return false;
if ( r1.y1 > r2.y2 ) return false;
if ( r1.y2 < r2.y1 ) return false;
return true;
}[/cpp]
[QUOTE=garry;19876463]You really shouldn't be pushing the player back. That's asking for trouble.[/QUOTE]
Indeed, pushing the player back is how to create physics which spaz out easily.
It can be funny, but it's not good :v:
[QUOTE=garry;19876463]You really shouldn't be pushing the player back. That's asking for trouble.
The movement code should be like Can we move to this new position?
Yes. Put the player there
No. Don't move. (Or more commonly, trace along that direction and move as far as we can move)
[editline]12:50PM[/editline]
Also, your collision code is pretty weird. Here's an example of how to do it nicely.
[cpp] inline bool RectIntersectRect( const Rect& r1, const Rect& r2 )
{
if ( r1.x1 > r2.x2 ) return false;
if ( r1.x2 < r2.x1 ) return false;
if ( r1.y1 > r2.y2 ) return false;
if ( r1.y2 < r2.y1 ) return false;
return true;
}[/cpp][/QUOTE]
What happens when you put inline before your function ?
[QUOTE=quincy18;19877926]What happens when you put inline before your function ?[/QUOTE]
It's almost like using a macro. The compiler will replace calls to the function with the code from the function's body. It's usually used in small functions and it helps reduce call overhead
[QUOTE=ltkerr0r;19878038]It's almost like using a macro. The compiler will replace calls to the function with the code from the function's body. It's usually used in small functions and it helps reduce call overhead[/QUOTE]
And what's the disadvantage? No recursion? Bigger executable size?
[QUOTE=Robber;19878130]And what's the disadvantage? No recursion? Bigger executable size?[/QUOTE]
If it's a gigantic function that is called a lot, then that function needs to be copied into each spot it's called in, making the file size huge. And I'm not positive, but I think that most compilers automatically calculate whether a function should be inline or not, so I've always left that choice to the compiler.
EDIT:
Yep, judging by this question:
[url]http://stackoverflow.com/questions/190232/can-a-recursive-function-be-inline[/url]
The inline specification is just a compiler hint, and most compilers completely ignore it nowadays.
[QUOTE=windwakr;19878745]Doom uses an advanced raycasting technique to render it's rooms. Here's a good starter tutorial on raycasting:
[URL]http://www.permadi.com/tutorial/raycast/index.html[/URL][/QUOTE]
I also recommend that tutorial. I used it as a basis for a Wolfentstein 3D remake I made about a year ago.
[QUOTE=Robber;19878130]And what's the disadvantage? No recursion? Bigger executable size?[/QUOTE]
Disadvantage is bigger code. AFAIK that means more cache miss.
Also it's not always obvious which functions you should inline, even if it may seem so. IMO you should be done with your application and have done your profiling before starting to wonder what to inline.
[hd]http://www.youtube.com/watch?v=WAzRUFmAtbo[/hd]
got a moddb page [url=http://www.moddb.com/games/rotion]here[/url] too
[QUOTE=NovembrDobby;19878977]
got a moddb page [URL="http://www.moddb.com/games/rotion"]here[/URL] too[/QUOTE]
I like the look of the level select screen. I could really see this working as an Xbox Live Arcade game.
I totally agree, that's some amazing work you've done there.
If it was on XBOX Live Arcade you've got my purchase.
Just FYI your compiler will almost always ignore the inline keyword, it will inline (or not inline) whatever it feels like if it thinks that doing so will bring higher performance.
Making an AI program that performs Best First Search on Super Mario Bros in order to beat levels...
[media]http://www.youtube.com/watch?v=2Yor3gmPkkg[/media]
[QUOTE=Lt_Captain;19879194]Making an AI program that performs Best First Search on Super Mario Bros in order to beat levels...
[URL="http://www.facepunch.com/#"]View YouTUBE video[/URL]
[URL]http://youtube.com/watch?v=2Yor3gmPkkg[/URL]
[/QUOTE]
That's hilarious. Have you tested it on any of the crazy mods people have made?
Not quite yet, it'll work on the basic overworld maps probably on the mods too, I don't think it'd find a solution for Asshole Mario or anything, but who knows
Does it take that long to compute an run or are you just displaying it?
When it runs, it sets the speed to maximum while searching, then normal for playback. In the AVI both speeds are normal. So yeah it runs faster than the vid shows.
[QUOTE=NovembrDobby;19878977][hd]http://www.youtube.com/watch?v=WAzRUFmAtbo[/hd]
got a moddb page [url=http://www.moddb.com/games/rotion]here[/url] too[/QUOTE]
You need some music! :swoon:
may I recommend you contact [url]http://www.starshipamazing.com/[/url]
[QUOTE=Lt_Captain;19879446](awesomeness)[/QUOTE]
That's awesome :D Never thought of using BFS like that :v:
Couple of questions:
- what version of SMB is that, any link?
- how do you keep the state of the game so you can go back and try a different path when there is no solution on the current path? Or do you just spawn a different instance of the game for every path?
That's really cool, I'm curious how you did it (the stuff other than the actual BFS algorithm, that is).
Sorry, you need to Log In to post a reply to this thread.