Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411663 Posts in 69396 Topics- by 58452 Members - Latest Member: Monkey Nuts

May 16, 2024, 04:44:24 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsPhantom Island
Pages: 1 2 3 [4] 5
Print
Author Topic: Phantom Island  (Read 19310 times)
Ben_Hurr
Level 10
*****


nom nom nom


View Profile
« Reply #60 on: December 16, 2011, 06:44:52 PM »

A bit off topic, but I'd sure like to learn how to do that effect.  Kiss

I used subtractive blending, which is: FinalRed = OriginalRed - BlendRed * BlendAlpha (and the same for the other channels). The result is clamped between 0 and 255, so dark original colours will turn pure black easily, compared to standard alpha blending where all original colours only turn black (or whatever the blend colour is) when alpha is full.

So to darken something using subtractive blending, you actually use white as the blend colour, as it subtracts the largest value. Notice that the hue of a colour can change as well, for example the tiles in the example pic become red when they're at half brightness, because the green and blue channels have already bottomed out at 0.

Google should provide the actual implementation info (that example was just a layer blend mode in GIMP).

Back on topic..

In fact each moving platform gets its basic properties from a specific tileset. That means a moving platform can have almost all the abilities of a tile in the static map (with notable exceptions being non-rectangular shapes, jump-through-ability and chain-reaction damage).

The platforming in this sounds great; very fully featured. Out of interest, why doesn't jump-through work on moving platforms?

Yeah, I'll probably have to look it up.
Although I'm not sure if I'll be able to pull it off, since I'm working in BlitzMax and don't really feel like playing with the sourcecode to achieve this. ):
Logged
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #61 on: December 22, 2011, 04:54:38 AM »

Spoilers! This post talks about a gameplay element of Phantom Island which might be a pleasant surprise if you don't know about it. Consequentially the images are purely linked to and the text is in a dead light colour so you hopefully don't accidentally read it.


Water!

One of the puzzle elements that'll feature in Phantom Island is water (although its full capabilities will be used sparingly). When you first encounter water, you'll assume the placid lakes of it are simply fixed pools of a different tile type, however that's not the case at all.

What I've done is cribbed the algorithm to simulate tile-based water from an old Sam Coupé game (that was an 8-bit computer!) called Waterworks. Because it had to run on an 8-bit machine, that means the algorithm is really very fast, but it also has a lot of draw-backs which require plastering over.

Let's take a look at some water...

http://www.drderekdoctors.com/phantomisland/frame_01.gif

This is a blob of water I've placed in the editor. I've not started simulating it, yet, which is why it's sitting over that gap at the bottom of the U-shaped container it's in.

If I run the simulation for a few frames we get to:

http://www.drderekdoctors.com/phantomisland/frame_02.gif

As you can see it's spread through the narrow area and the pressure of the main body of it has forced it up and out of the "pipes". You'll notice this is simply displaying how full each tile of water is, rather than choosing a aesthetically pleasing image to represent the water in that tile. That's one of the draw-backs which requires plastering over.

Ptoing wants the water to be converted to and from a particle system in these instances, but to be honest it's a pretty damn tall order to reconcile two such systems so I'll be surprised if it happens.

If I turn on a coupla' diagnostic overlays, it'll make it clearer.

http://www.drderekdoctors.com/phantomisland/frame_03.gif

The reddening of the squares indicates pressure, the arrows indicate the direction of flow. The flow is purely calculated from the shift of water from cell to cell, but it also feeds back into the system causing small "waves" to be apparent on the surface of the water sometimes. It'll also be useful for causing anything in the water to be pushed along by its current.

Now if we run the simulation for a while longer...

http://www.drderekdoctors.com/phantomisland/frame_04.gif

...you'll see it's settled down a bit (note it doesn't drain out of the bottom of screens yet - and no, that won't make it move into the screen below). The eagle-eyed viewer will notice it appears to take up a LOT more space than it did in the initial screenshot. That's how this system works. A cell of water under pressure holds more water. That does make it look a bit odd when it spreads out from a vertical shape to a horizontal one, but it means that you get pressure simulation as part of the simulation, which is essential to the sort of puzzles I'm intending. And my, what puzzles they shall be... Wink

And that's that, really. Now I just gotta' make it look less crap.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
:^)
Level 10
*****


wat a hell


View Profile WWW
« Reply #62 on: December 22, 2011, 12:01:31 PM »

looks cool
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #63 on: February 12, 2012, 10:07:49 AM »

Is progress being made good sir?
Logged
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #64 on: February 12, 2012, 10:36:56 AM »

Yeah, slow but good. I've took a break from proper coding recently to work on the potion system, which I'm looking forward to seeing in action. I've decided to eschew pre-defined potions recipes for simply having ingredients have dominant, recessive and side-effects, as well as other properties which define what ratio you should mix them in and temperature you should brew them at, with imperfect recipes providing feedback that helps you refine it. I'm back on it now, though. Gonna' try and get an animated fellow running around waving a sword and smacking summat soon.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
Ghidorah
Level 0
**



View Profile
« Reply #65 on: March 15, 2012, 01:31:10 PM »

Can't wait to see more!
Logged

Woody, Philadelphia PA http://winnitronnyc.blogspot.com/
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #66 on: March 15, 2012, 02:12:44 PM »

Yeah, sorry I've been crappy at updating.

I'm working on the process code at the moment, which is a visual kinda' scripting language like a flow chart which determines all the game logic and a bunch of the NPC/creature behaviour, too. It looks a bit* like this:

http://www.drderekdoctors.com/phantomisland/process_editor.gif

I've never been one for doing anything sensible like learning LUA. Wink

Because it boils down to a load of integers in a switch/case statement, it should be lightning fast, which is handy as everything will be running a process.

Next up, getting something animated on screen, although the current programmer graphics don't exactly look good...

http://www.drderekdoctors.com/phantomisland/my_crappy_graphics.gif




* precisely.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
happymonster
Level 10
*****



View Profile WWW
« Reply #67 on: March 15, 2012, 02:18:27 PM »

Now that's what I call ambitious!!  WTF
Logged
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #68 on: March 15, 2012, 02:24:33 PM »

Haha! The basic structure is really simple, it's just coding all the little logic box commands which is time-consuming. It's similar to how my old engine worked, but without the MASSIVE BALL-ACHE of having to write a parser and then track down syntax errors in my scripts, because it simply won't let you put invalid data into the system (if there's any in there the process simply throws an error at runtime, and if you look in the process editor the offending box has a line pulsing out of it). I must admit though, that the level of data-driven-ness in the engine is a bit ridiculous.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
Udderdude
Level 10
*****


View Profile WWW
« Reply #69 on: April 27, 2012, 05:00:28 AM »

You've made things very flexible, hopefully it's good enough to re-use for future projects.
Logged
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #70 on: April 27, 2012, 05:11:33 AM »

Cheers, yuss, that's the plan. I managed to eke four projects out of my last engine (although two of those weren't games with one being my Edinburgh show when I did stand-up).

After PI, me an' Sven will think about what to do next. I know I wanna' do a top-down Gauntletty game.

In proper PI news, I got a dude picking up a sword which he could then CARRY TO ANOTHER ROOM! Yeah, baby steps. It's weird doing it this way as it means that suddenly I'll be able to do tons of stuff, but it's getting all those systems in place which is time-consuming/will-sapping.

This weekend I wanna' get him to luzz the sword at a something.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
Oddball
Level 10
*****


David Williamson


View Profile WWW
« Reply #71 on: April 27, 2012, 05:47:30 AM »

I was lucky enough to see this in person at the MCR Game Jam. It's damn impressive, especially all those editors. Also the simulation stuff that Graham declared spoiler earlier was splendid running live.
Logged

DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #72 on: June 12, 2012, 12:27:22 PM »

Necessary Digressions...

So this post is about how one thing leads to another. After I got my player character into the game and popped in a sword which he could pick up and throw (which is all controlled by scripting and whatnot), I thought "well, I should make him throw it at someone so I can test the collision code is working".

Which meant I had to make an enemy.

But that got me thinking about how my enemies are going to get around the world. While many of them will have simplistic behaviours, it'd still be nice if there was a really fast, non-iterative way of detecting the ends of platforms so they didn't walk off of them if I didn't want them to. That's incredibly easily done if your game doesn't have slopes, but mine does so it requires a little more computation than "is there a tile to the right of this tile?", as that would result in non-ends of platforms being flagged as ends of platforms.

So instead of doing these calculations in real time, I do it when the room is entered (or altered) and store the information in a layer of data, resulting in nice clean information which looks like this:



(Navmap flags are stored in "surface" tiles, which are directly above the topmost solid tile. That's why they appear to be floating)

And for comparison, without the guff.



But while I was doing that, I thought I may as well find locations of jumps up to platforms, jumps from platform to platform, slopes which some enemies might not be able to handle, climbable surfaces, etc, and flag those in the same manner. Which meant the data became this:



(Blue lines indicate the links between jump points)

And then I thought, well... I may as well flag walls and ceiling, too, so creatures like spiders know where they can jump to in order to get closer to the player.



Once that was done, I thought - hmm... it'd be nice if some enemies were capable of pathing towards the player. Now, for a while I did go down the route of trying to make enemies able to path via platforms, climbable areas and walls/ceiling but that soon gave me a massive headache and instead I decided to limit it to flying enemies, because I don't have to worry about terrain with them. Plus, I think that fairly simplistic behaviours for the platform-bound enemies should make them tricky enough to deal with as it is.

I've decided to go with a look-up table based pathfinding solution, rather than A*, as it makes the pathfinding effectively FREE to use, which'll be important if I have 30 wasps trying to path towards different moving targets every frame. To make the look-up table I fill all the free space in the room with rectangular areas, like so:

Yes, the patterns *are* pretty. Then I see which of these areas are adjacent to which other areas and draw up lists of connections. Finally I use that connection data to pre-calculate the shortest route to every cell in the map from every other cell, via a simple recursive function. And that gives me my look-up table.

To show it in action, the following animated gif shows the order in which an entity anywhere on the map would path through the areas in order to get to the player if they were at the bottom-left of the map. NB. the dots don't show their exact path, it just shows which area they'd aim for from any given area, so it's only a macro-level solution.



(Oh, and I still need to tweak the generation routine to deal correctly with one-way platforms, but that's a minor thing.)

And that's how digressions work. Tongue Now, about that enemy I wanted to hit with a sword...
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
sabajt
Level 1
*



View Profile WWW
« Reply #73 on: June 12, 2012, 02:06:20 PM »

really nice to watch  Smiley and cool to read how it took form - a surprising process!
Logged

Ishi
Pixelhead
Level 10
******


coffee&coding


View Profile WWW
« Reply #74 on: June 12, 2012, 02:07:49 PM »

Lovely attention to detail in the tech!
Logged

wg/funstorm
Level 0
***



View Profile WWW
« Reply #75 on: June 12, 2012, 10:10:55 PM »

Cool! Just out of curiosity, how many entries does your lookup table have? I think I counnt 51 areas... so 2601?
Logged

DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #76 on: June 12, 2012, 11:11:36 PM »

Ta' sabajt and Ishi. Smiley

And yup, you're correct, funstorm. And in this specific case, 10k is a small price to pay for instantaneous macro-level pathfinding, I think.

The only issue is with changes to larger/more complex rooms, where I'll possibly have to regenerate the table over the course of a few frames in order not to hit the framerate, but the pathfinding data is double-buffered so it can do that in the background and then just swap it in. I'll probably make some deliberately complicated room designs in a while to see what kinda' area count it leads to.

The only thing I don't like about this system is that because you can't predict how big the look-up table is gonna' be, you have to allocate it every time which isn't so good for memory fragmentation, but I'm probably being over-cautious, tbh.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
tok
Level 4
****


View Profile
« Reply #77 on: February 20, 2015, 05:49:26 PM »

nice game. is there an update ptoing? you know i love your art right?

drderic, im a fan of your podcast, the arsecast. i used to listen to it back when it was new.
Logged
Octopus Tophat
Level 1
*



View Profile
« Reply #78 on: February 20, 2015, 06:23:10 PM »

Wow this is old.  I hope you didn't give up on this!  The A.I is really interesting to me.  I've been thinking of ways to tackle pathfinding in my game, which has procedurally generated levels.  I'd really like to hear more about how it works.
Logged

Roguelike platformer: RogueWorld
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #79 on: February 21, 2015, 07:29:55 AM »

I've been re-doing it from scratch as the old engine got massively unwieldy and the new one is much more modular and nice (I'm doing a small puzzle game in it first to test all of its functions). Are you talking about platform-based path-finding or is it top-down and therefor you don't have to worry about platforms and it can just be the simple look-up style stuff?
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
Pages: 1 2 3 [4] 5
Print
Jump to:  

Theme orange-lt created by panic