• entries
32
50
• views
46202

1126 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

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!

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.

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!

## Create an account

Register a new account