Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 9 Vote(s) - 4.56 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Work in progress Katamari: The dark descent (Update 16/11)
Adrianis Offline
Senior Member

Posts: 620
Threads: 6
Joined: Feb 2012
Reputation: 27
#31
RE: Katamari: The dark descent

That trailer is bloody brilliant
04-09-2012, 11:12 PM
Find
darkadders Offline
Junior Member

Posts: 44
Threads: 1
Joined: Mar 2012
Reputation: 3
#32
RE: Katamari: The dark descent

(08-02-2011, 05:05 PM)Apjjm Wrote:
Contact point discovery
Spoiler below!

Given a spherical object A is colliding with object B, how do i find the contact point on object A?
[Image: 9QF9C.png]
Amnesia has no way, sadly, to determine the position of entities or contact points using available functions. Filling the entire map with script areas would solve the problem, but for just a 5x5x5 room, with enough script areas to accurately determine a box and a ball colliding, you'd be looking at 8,000 entities - then for each of these areas you would have to check for collisions between the two objects to determine a set of points, This is far too much work to do without lag, let alone in a 200x200x20 map!

However, given that we know the two objects must be close to each-other, we can reduce that obscene amount of areas to ~100 static entities, which exist for under a frame, and only a few of which are ever even in the game at the same time!

The solution: As soon as a collision occurs, create a large box around one of the colliding objects (in this mod it is the katamari, and is done using the AddAttachedPropToProp function). If there is a collision with the big box and both entities, we split the big box into 8 smaller boxes. We then do that same process for all 8 smaller boxes, and keep going until the boxes are really small. As soon as we have determined a collision for a box, we can destroy that box (RemoveAttachedPropFromProp).
[Image: x68UO.png]
This is like an octree spatial partitioning technique, except we don't bother saving the tree, as it will be useless after we get the contact points. We keep dividing down and hone in on all the boxes that collide with both objects. We get a head-start, too, as we actually start at the centre of our spherical object.
[Image: verED.png]

At the smallest box size, we may have multiple boxes that collide with both entities! We want one contact point, not a set! Thankfully, because we created each box this frame, we know the position of each one relative to our first entity (the katamari). All we do is calculate the (square) distance from the katamari for each small box - we then only keep the position that was furthest away - as this will be the point at which the main object (katamari) first touched the other object. This is all the information we need to get where to attach the object to on the katamari.

This is just a quick overview, the code this time around is much better organised and commented than with tetris, so when the mod is released and you want to see exactly how it was done, then it shouldn't be too hard to follow Wink.

mind = f***ed


props to you guys for figuring out how to make these things; its harder than it looks Q_Q

04-10-2012, 02:26 PM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#33
RE: Katamari: The dark descent

Good news and bad news. First the bad news: I'm going to have to re-code katamari from the ground up again (minus the collision detection). This is because of a fundamental change in approach to resizing the katamari.


The good news is that I have found a better way to re-size the katamari, in what I can only describe as thoroughly abusing a glitch to get around a more random, preventative, glitch (the preventative glitch being that the game would randomly not load in the next size of katamari, forcing a level reload). This new method will let me arbitrarily upsize & downsize the katamari at will, rather than in a strict linear fashion. This should let me recover from the above glitch occurring (but in a trial of about 100 size changes the glitch didn't occur, when before it was about 1/8 chance). Bad news is that this also effects the way the katamari handles (a resize will now stop all katamari motion), but there really isn't much I can do about that, sadly. The recode also gives me an opportunity to fix the tangled mess a couple of the attach functions have become due to various experiments in trying to mitigate the dissapearing-katamari bug.
(This post was last modified: 06-09-2012, 06:03 PM by Apjjm.)
06-09-2012, 06:01 PM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#34
RE: Katamari: The dark descent

Oh wow... I thought you stopped making this all-together.

May I ask why you needed to resize the Katamari?
06-10-2012, 12:07 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#35
RE: Katamari: The dark descent

By "resizing the katamari" I was meaning "resizing the body which the katamari uses to collide with it's surrounding", which was required so that attachments wouldn't clip through the floor/walls when the katamari got big. I apologise for the lack of updates prior to this one, but I had hit a road block a while back with the game doing some glitchy behaviour (the props randomly not being loaded in) as well as being particularly busy at university with a tonne of assignments (and more recently exams).
06-10-2012, 02:26 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#36
RE: Katamari: The dark descent

No problem =] Hope everything is going well for you! Glad to see you're still up for this challenge. I can see what you mean with the larger body sizes now. That never occurred to me until you said it. =\
06-10-2012, 03:03 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#37
RE: Katamari: The dark descent

Here's a video showcasing the resize / entity replacement method. I managed to get quite a bit done today, so i'm pretty please with progress. Should be back up to where I was soon.

http://youtu.be/u5vBMmCzNqc
06-10-2012, 03:40 AM
Find
Science Offline
Junior Member

Posts: 9
Threads: 0
Joined: Jun 2012
Reputation: 0
#38
RE: Katamari: The dark descent

Dammit Apjjm, every time I read something you wrote your avatar looks more and more like a Khajiit from Skyrim. What is this wizardry.
06-10-2012, 06:04 AM
Find
Statyk Offline
Schrödinger's Mod

Posts: 4,390
Threads: 72
Joined: Sep 2011
Reputation: 241
#39
RE: Katamari: The dark descent

(06-10-2012, 06:04 AM)Science Wrote: Dammit Apjjm, every time I read something you wrote your avatar looks more and more like a Khajiit from Skyrim. What is this wizardry.
I've never played Skyrim but whenever I see Apjjm's avatar, I think it's a T-rex creature in a mage robe. It wasn't until about a month ago that I noticed it was a dinosaur in a jet...

I liked the mage robe. He was cool =[
06-10-2012, 07:02 AM
Find
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#40
RE: Katamari: The dark descent

(06-10-2012, 07:02 AM)Statyk Wrote:
(06-10-2012, 06:04 AM)Science Wrote: Dammit Apjjm, every time I read something you wrote your avatar looks more and more like a Khajiit from Skyrim. What is this wizardry.
I've never played Skyrim but whenever I see Apjjm's avatar, I think it's a T-rex creature in a mage robe. It wasn't until about a month ago that I noticed it was a dinosaur in a jet...

I liked the mage robe. He was cool =[
I always though it was a t-rex in a astronaut's suit :3

I rate it 3 memes.
06-10-2012, 11:48 AM
Find




Users browsing this thread: 2 Guest(s)