Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 11:16:42 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsMoonQuest
Pages: 1 ... 173 174 [175] 176 177 ... 189
Print
Author Topic: MoonQuest  (Read 1322525 times)
rek
Level 7
**


View Profile
« Reply #3480 on: March 03, 2016, 08:56:45 AM »



You have to use this somewhere! It could be the Moonman equivalent of Touch Fuzzy, Get Dizzy.
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3481 on: March 03, 2016, 02:07:07 PM »

> You have to use this somewhere! It could be the Moonman equivalent of Touch Fuzzy, Get Dizzy.

Oh yeah for sure. I have a similar effect already when you wear one of the masks.

Update: The final closed alpha build is now out for Windows and OSX. If you're a tester then jump on the Alpha forum and please leave some feedback. Now I'm off to 'Merica for a few weeks!
Logged

benjkers
Level 0
***


digging for precious games


View Profile WWW
« Reply #3482 on: March 03, 2016, 06:49:15 PM »

That distortion - can't pull my eyes away. Tops. Have fun in the States!
Logged

RujiK
Level 2
**



View Profile
« Reply #3483 on: March 04, 2016, 06:12:13 AM »

TOUCH FUZZY GET DIZZZY!!!! YEAHEAYEHAYEHYAEHA

That is the most memorable mario level in existence. Also it is pretty impressive from a technological perspective since Yoshi actually leans/runs downwards against the distortion.
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3484 on: March 04, 2016, 02:41:01 PM »

it is pretty impressive from a technological perspective since Yoshi actually leans/runs downwards against the distortion.

Oh really? That sounds pretty amazing :D
Logged

Recs
Level 0
***



View Profile
« Reply #3485 on: March 16, 2016, 11:43:07 PM »

following, very interesting.
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3486 on: April 03, 2016, 02:58:36 PM »

Update: I'm back from the USA. Here's a post about my trip. GDC was amazing and it was awesome to meet so many of my TIG friends there. I got to see a talk by the Rain World crew which was super inspiring, that game is coming along really well!
Logged

KaiTheSpy
Level 0
***


how to make the game


View Profile
« Reply #3487 on: April 03, 2016, 03:21:33 PM »

How was Seattle? Did you see Pike Place Market?
Logged

i am a 14 year old loser who sort of knows how to program
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3488 on: April 03, 2016, 03:27:31 PM »

How was Seattle? Did you see Pike Place Market?

Seattle was cool. Stayed with a friend who works for Amazon AWS and it was crazy to see how big that company is ... inhabiting like 5 sky scrapers and building more. Yeah we went to Pike Place Market and I bought a banana. The EMP museum was quite interesting - I loved the little sci-fi section with props from Alien, Terminator, Fifth Element, etc. Overall Seattle was interesting but it seemed way too cold for me. Portland was super chill and I'd love to spend more time there. SF was a weird mix of ultra rich and poor, not sure I'd like to live there.
Logged

KaiTheSpy
Level 0
***


how to make the game


View Profile
« Reply #3489 on: April 03, 2016, 04:03:36 PM »

I live there and I think its too cold too
Logged

i am a 14 year old loser who sort of knows how to program
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3490 on: April 09, 2016, 05:29:20 PM »

The devlog marches on! Will I ever finish this thing?

Update: I've begun work on the AI system. My immediately goal is to have more intelligent enemies and NPCs. They'll eventually be able to pathfind around obstacles and will be smarter during combat. In addition they'll have more behaviour types; for example, a warrior with a guard behaviour would only chase the player a certain distance before returning to his post.

Here's a gif of the first steps of the new system.

If I get time I really want to implement a few idle actions to add more character to the game. Imagine watching an NPC walk over to a chest, take out a rock, and then throw the rock into a hole. It's a nonsense set of actions but it links together the different aspects of the world, which is important if you want the world to feel alive and cohesive.

Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3491 on: April 14, 2016, 08:49:22 PM »

Update: This week I've been teaching the AI how to jump.

A simplified version of the problem is this: In order to jump N units across, how much vertical and horizontal force do i need to apply?

One way to approach this is analytically, by calculating the trajectory an entity would take if he jumped with a certain force, and then using the inverse of the equation to get the force required to jump a certain distance. Depending on the complexity of your physics engine this may be possible; however, the simulation in Moonman is too complex (esp. as it uses Box2D) for me to try this.

Another approach is experimental: simulate a whole range of jumps inside your game and use that data to inform you jump calculation. This is exactly what I've done. After setting up a test harness, I simulated a mob of humans jumping with varying jump parameters (equivalent to a player's duration of jump button pressed and duration of move button pressed). From this I extracted the distance and height jumped, and plotted it below. Each blue point in the graph corresponds to a certain (jump,move) parameter.





Analysing the data I saw a few interesting things, which I've outlined on the rough diagram below. Most importantly, note that to jump 3 units across, there is a minimum vertical force we need, and a maximum height we can reach based on jump force. For a jump that spans 3 units we can have a low jump or a high jump, or somewhere in between.



I then processed this data with a Python script to get the minimum and maximum jump parameters for each jump distance. In the code below, for example, you can see that to jump 2 units horizontal with a minimum amount of force, you need to have your jump = 0.01 and move = 0.073. These values directly map to how long the AI holds down the jump button and the move left/right button.



Here's an early test of the system. Lava added for malevolent reasons. Goose-knight is ok at jumping, but not good enough, and must suffer the consequence.



This approach doesn't factor in vertical height. For example, jumping 3 units across and 1 unit up will require different parameters than jumping just 3 units across.

We could solve that problem with experimental data. But I've decided to fudge it: if an AI wants to jump N units horizontally and 1 unit vertically, I simply add a little to the jump parameter and remove a little from the move parameter. If it wants to jump 3 units vertically, I add more, and so on. This approach seems to work so far, and because you can adjust your horizontal movement mid-air there's a little lee-way with this.

Here's a (sped-up) gif of some mobs jumping around between platforms.



And oh! I've discovered a glitch in the game, which I call the splash jump. If you walk off a ledge and jump just as you hit the water, you'll jump about a block higher than normal. This is because when you're in water your jump force has a multiplier. I could remove this bug but I like it, so it stays.



But, like always, it's the malfunctioning code that is the best. This guy was really struggling with the concept of jumping.


Logged

Zorg
Level 9
****



View Profile
« Reply #3492 on: April 15, 2016, 12:55:03 AM »

Update: This week I've been teaching the AI how to jump. [...]

One way to approach this is analytically, by calculating the trajectory an entity would take if he jumped with a certain force, and then using the inverse of the equation to get the force required to jump a certain distance. Depending on the complexity of your physics engine this may be possible; however, the simulation in Moonman is too complex (esp. as it uses Box2D) for me to try this. [...]

I'm not sure if the analytical approach is that complex as you don't seem to steer mid-air:

Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3493 on: April 15, 2016, 03:33:29 PM »

Update: This week I've been teaching the AI how to jump. [...]

I'm not sure if the analytical approach is that complex as you don't seem to steer mid-air..


The jumps are not pure parabolas, see the gif with the two knights. They don't move at a constant speed horizontally and their vertical accelleration isn't exactly constant either. Some variables that make the analysis complex are: jump force, jump duration, mass, move duration, move speed, a pause at top of jump, and dampening on horizontal movement.

A parabola would be a decent estimate though.
Logged

eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3494 on: April 22, 2016, 08:46:10 PM »

Update:

This week I've been implementing A*-pathfinding for the AI -- this will allow enemies or NPCs to find a short path through the world to moonman or some other target.

Starting simple, here is a case where the target location is the top of those tiles, and the knight knows that he has to take a series of jumps on the left hand side. The planner knows how to move and jump and searches the entire nearby space for the quickest route to the top.



Here's a more complex case. The squares show the potential tiles the knight will move through, and each one is checked for collision. If a tile is blocked then the path-finder will find another way around (if there is one).



One interesting problem I had was to predict which tiles a human would move through as they jumped. To solve this I assumed the jump path was perfectly parabolic, which isn't exactly correct, but a good enough estimate for now. The problem then becomes: given start and end locations and jump height, what parabola goes through those points?

A page or two of algebra, and many mistakes later, I ended up with the equation. You can actually play with the equation over here on Desmos. For that equation I assumed the mob was at the origin and wanted to jump to point q, with a height h.



You can then trace out the parabola in tile-space (adding the human height along the way), and if it collides with a block then you know the jump won't be successful. In terms of A*-search, this path (between p and q via a jump) would be invalid.



You can see the behaviour of the path-finder below. As I move the target around the algorithm finds a new shortest path.



It's important to note that the path is an ideal path, and assumes a perfect ability to jump between platforms, etc. Following the path is another thing altogether (especially in a physics simulation) and the success will depend on environmental factors, the physics state of the mob, and some how precise the AI-control can time things. But for the most part a mob will be able to follow a path fairly well .. and if it fails at any point then it'll simply re-plan and try again.

Here's a video of a knight following a path. He's pretty good at jumping between all those platforms, although halfway through he fails a jump and has to re-plan the route.

And here's a gif or a knight following Moonman (crunched to a few colours because of it's size):



The implementation is super simple at the moment and there are a lot of things that the pathfinding doesn't consider yet, like doors, sloped terrain, bridges, platforms, ladders, etc. These will all be brought into the system one by one until we have some semi-intelligent mobs that can't be tricked so easily.

The path-finding and path-following components are just one piece of the AI system, but I think it'll be the trickiest to implement. One necessary optimisation I need to add, for instance, is to cache the graph for the A* system. Being tile-based, Moonman has part of a graph already (just use the tiles and their neighbours), however it doesn't account for jumping to and falling from ledges, and I'll need to find and cache that info whenever the world geometry changes.

It's interesting also to consider how A*-search would work if entities are allowed to modify the world/graph. For instance, if an enemy in Moonman could mine through a wall or build a bridge, how would that effect the pathfinding system? I assume it's a very difficult problem to do well, although some basic logic for hacking through a wall could push the game in a very interesting direction! For now though, it's in the todo-later basket.

Another interesting thing I've been thinking of is path-finding or following going wrong. Consider a "dumb' enemy. Would he make a bad plan? Would he make bad assumptions about the distance he can jump? Would he cancel a plan halfway through? When coding the system I stumbled across a bug that revealed a strange, but entertaining, behaviour. Here the knight believes the shortest path to the spaceman is to bunnyhop the entire way. See you next time!




Logged

BomberTREE
Level 9
****



View Profile
« Reply #3495 on: April 23, 2016, 12:37:43 PM »

Oh wow Kiss
That's really impressive, and fun to see in practice!

Good job  Hand Thumbs Up Right
Logged
Bricabrac
Level 2
**


Fail again. Fail better.


View Profile
« Reply #3496 on: April 23, 2016, 01:06:26 PM »

Following! I love Terraria, this world seem a funny one to explore.
Logged

Selling Sunlight - Wandering Merchant RPG
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3497 on: April 25, 2016, 03:41:37 PM »

Cheers! Smiley
Logged

Rusk
Level 1
*


View Profile
« Reply #3498 on: April 25, 2016, 05:03:45 PM »

What a great couple of posts! Very interesting!
Logged
eigenbom
Level 10
*****


@eigenbom


View Profile WWW
« Reply #3499 on: April 29, 2016, 05:15:52 PM »

Thx Rusk!

Update: This week I implemented the Path Graph, a data structure which stores information for more efficient path-finding. This is a necessary optimisation to allow the path-finding to work fast enough on big levels with many path-finding agents.

The Path Graph caches all walkable tiles, roughly guesses where jumps and falls may occur, and will eventually include info about bridges, one-way platforms, ladders, and so on. Then, instead of examining the world directly, the path-finding routine uses the graph.

Here's a screenshot of the PathGraph. A yellow line links two tiles if an entity could potentially jump from one to the other. A pink line designates a fall between one tile and another. To optimise this further I could cull many of the yellow lines by doing simple path-collision checks -- but I'll leave that for another day if I see performance issues. For now it works really well.



The Pyre/Volcano level is coming along nicely. The area will be split into the volcanic terrain part, and an underground cathedral-type structure. At the very base of the cathedral will be The Archive, an abandoned repository of knowledge with stacks of books and bookshelves. A creature we're calling The Librarian will roam around this area.

The cathedral itself will be split into multiple sections, connected by long diagonal tunnels, and the entire area will be a mix of reds and purples.



We've also started on the concepts for the Veil area, things are moving quickly now. Next week I'll go through the designs for the labyrinth in the Veil. Lastly, here's a gif of the jump links in the Path Graph which are updating dynamically as I modify the world.

Logged

Pages: 1 ... 173 174 [175] 176 177 ... 189
Print
Jump to:  

Theme orange-lt created by panic