Jump to content
  • entries
    32
  • comments
    50
  • views
    46084

Updates on top of updates

Sign in to follow this  
CulDeVu

1101 views

'Ello there!

Just kidding. Not really that many updates. Just a few minor things, honestly, while I'm working on getting the first piece of artwork done.

So I read something swiftcoder say[quote]
I keep a tally of all the bugs I have fixed with a single line code change. Over time it's reached a fairly horrifying number[/quote]

That sounds like a fantastic idea!

I'll start my own count with this one from the physics engine. There was this bug that if you jumped on a small distortion on the wall, you could clip through it, and sometimes you could clip through the wall. So I started rummaging through the codebase and eventually honed in on this little piece of code:// only segment the parts that need itif (lastWasWarped) { if (distortedPt0_temp.sub(wsPt0).lengthsqr() < 0.01f && distortedPt1_temp.sub(wsPt1).lengthsqr() < 0.01f) { lastWasWarped = false; } else lastWasWarped = true;} else { if (distortedPt0_temp.sub(wsPt0).lengthsqr() < 0.01f && distortedPt1_temp.sub(wsPt1).lengthsqr() < 0.01f) { line last = line_cache.get(line_cache.size() - 1); last.p1 = distortedPt1_temp; continue; }}
This was the piece of the physics code that tries to figure out if the geometry is distorted or if the geometry can possibly be batched into straight lines of some sort. This was done in order to mitigate getting stuck on corners everywhere when simply walking over normal terrain.


As Jonathan Blow said in his recent programming language videos, a large portion of bugs in programs come from not reasoning through state changes correctly. Couldn't be truer here::// only segment the parts that need itif (lastWasWarped) { if (distortedPt0_temp.sub(wsPt0).lengthsqr() < 0.01f && distortedPt1_temp.sub(wsPt1).lengthsqr() < 0.01f) { lastWasWarped = false; } else lastWasWarped = true;} else { if (distortedPt0_temp.sub(wsPt0).lengthsqr() < 0.01f && distortedPt1_temp.sub(wsPt1).lengthsqr() < 0.01f) { line last = line_cache.get(line_cache.size() - 1); last.p1 = distortedPt1_temp; continue; } else lastWasWarped = true;}
So that one line, that single else clause, stopped the clipping issues. Now, as far as I can tell, with the current system I've got going on, the collision system is impenetrable! At least until I find some other bug tongue.png

The bug fix also allowed me to do cool things, like scale walls, like in this video:


But yeah. Nothing much else happened this week. If anything absolutely crazy happens, I'll let you guys know next week.

See yah!

EDIT: actually, the journals view counter has been acting weird ever since the new years. It always reads 0 views for me, even though I can see members visiting the journal and upvoting stuff. Is a fix coming soon? Because I kinda like to know how many people actually read this stuff, like on RSS feeds and the like. It's a sort of selfish request, but it would really help to know. Thanks!
Sign in to follow this  


2 Comments


Recommended Comments

What if you used convex hulls or splines in 3D and had warped 3D time-space. A boxy world seems limited but still cool to see a prototype in action.

Yeah I hate how the view counter is always at 0.

Share this comment


Link to comment

Well, honestly, I haven't used anything other than tilesets for this one because last time I tried making a game with a vector-based world I absolutely hated it. It was nice for prototyping weird levels, but the art pipeline required a herculean effort to get it looking good and wasn't really suited for fast stylistic prototyping, I thought, for a single developer. The only way I could see it being worthwhile is if I get up some sort of procedural plant and dirt generation, or something that can automate the level art somehow.

 

 

As for warping time-space, that sounds really cool! I don't know if the physics engine could take much more than slowing down time, but it'd be cool to try out!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!