Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411521 Posts in 69380 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 03:56:28 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsDriller (2D cave mining)
Pages: [1]
Print
Author Topic: Driller (2D cave mining)  (Read 7706 times)
deadZed
Level 0
**



View Profile
« on: September 22, 2011, 01:59:55 PM »


(working title)

Intro

I had this idea growing in my mind about a 2d mining game. Yes another one, i just want to explore the concepts around it and see what i can get going. Im not a technically skilled game developer so bare with me if some of these concepts are basic stuff - hopefully someone can lear something along with me. Today theres terraria, minecraft, spelunky, cavestory and now im just naming games that i think might have some connection to this. I havent played any of these games but know the mechanics of minecraft (from seeing it played) Theres also the wicked beautiful game (art and concept) in devlogs about mining/exploring caves, this has been very inspirational (cant find link). Also this one, and this one. Got any more games i should look up?

   (Some of the following is written in retrospect just to cut things up)

Update: A few moving images!


« Last Edit: September 27, 2011, 10:48:55 PM by deadZed » Logged

deadZed
Level 0
**



View Profile
« Reply #1 on: September 22, 2011, 02:03:18 PM »

Procedural generated maps

This sounded as a given for this game, organic feeling and can be made huge without effort. Originally i knew i somehow could use the "filter->generate cloud" function in photoshop. I then learnt that this is called perlin noise and is availible natively in flash! - where i will be exploring this concept. I remember reading the thread on here with procedural map generation long ago (images in my head of top down green/blue earth maps).

First part was just getting some perlin noise onto the bitmap, and setting "levels" where the materials would change, or it beeing empty cavities. I added some rarer spots (minerals/precious metals?) that changed as we get deedper. This gave somewhat satisfying map instances but i wanted something that stood out of the regularity of the noise. I then learned of the "random walk" method in the previously mentioned thread. This is where you take a starting point, and then just randomly walk in one direction - rinse and repeat a couple of thousand times - and youve got a continous path thats also a neat cave! I added this on top of the perlin noise smoothed and some other filtering to make it blend in nicely. The "random" walk always start fairly far down the map in the center, and then has a favor of going upwards during generation, this makes these nice caves making its way from the surface down into the deep center of the level. Something for the player to start exploring from. Got any ideas on what could be added or adjusted to make more interesting maps?

Center image is random walk - that is then added to the right image of perlin noise, and thats then run through the "leveling" algoritm that makes the final left image of the map. Black and brown is solid, white and gray is open caves. Bright color is rare mineral

« Last Edit: September 22, 2011, 02:09:29 PM by deadZed » Logged

deadZed
Level 0
**



View Profile
« Reply #2 on: September 22, 2011, 02:07:31 PM »

Better maps

Ive been tuning the procedural map generation algoritm. A surface (mountain range) is now created from the top row of noise in the bitmap - thats drawn as a heightmap at the far top of the bitmap and everything above is blanked. It follows through with the blurring and filtering to smooth it out and give a nice cave entrance. The map is now gradually heavier on rock towards the bottom, also suggested by bertling (cant be seen in this screenshot but will in the next)


Sroll right for the perlin noise
Logged

deadZed
Level 0
**



View Profile
« Reply #3 on: September 22, 2011, 10:05:42 PM »

Tiling system

In order to explore the maps ive made a tiling system, more exactly the drawing and removing of tiles, and their physical representation. Drawing out the entire level and just panning would be too heavy (even if tiles are set to visible=false, since they still consume memory). Mapsize right now is about a quarter million tiles (!) and box2d has a preset limit off 500 physics bodies, this can be overridden but im guessing performance will be suffering. Problem areas have been the corners of the "square" that should be displayed, previously some leftover tiles would be left randomly when panning diagonally. This has been bruteforce-fixed by just testing values in what order and what tiles should be destroyed/drawn.

The creation of physical bodies is not separated from the visual tile. This will come back and bite me in the ass when i realize there will need to be physical bodies outside of the visual screen. Im keeping the amount of physical bodies down by just creating bodies along the "edge" tiles of the massive parts.

Object pooling of tiles experiment did not work.I found the lightweight class "shape" instead, only incorporating graphics and no other fuzz. I swapped all "heavy" Sprites and MovieClips for it.

(Old screenshot)
Logged

deadZed
Level 0
**



View Profile
« Reply #4 on: September 22, 2011, 10:13:30 PM »

Tile graphics

Realizing i probably wont be able to draw vector tiles for everything very well, i decided to generate tiles on the fly (see a running theme here? =)). Tiles are checked for type, background is drawn, possibly "texture" is drawn. Then checked for adjectent tiles, and respective shading is drawn in that direction. Top side is trying for a "perspective" look where you can see the top and stuff rests a couple of pixels down

This has given me the ability to just pass any "base" color to the level and tiles are drawn with respective shadings in that hue. Right now its just brown sand, but say on mars it could be "reddish"

Logged

baconman
Level 10
*****


Design Guru


View Profile WWW
« Reply #5 on: September 23, 2011, 04:39:50 AM »

You talking about Oze, the one with the super-physics rope? It's in redevelopment mode right now; and a few other influences you may want to check out include Spelunker (NES) or Spelunker HD (PSN), DigDug and DigDug Arrangment, and perhaps even Mr. Driller. There's also an older finalized project here called "Under The Garden," which plays more on the survival principles and less on the mining as many of the aforementioned.

Personally, I've gotten more into Spelunky, Terraria, Oze, simply-titled Mining Game, Mr. Driller, and Spelunker HD. I would like to be eagerly anticipating Junk Jack too, as I've been pretty active/supportive in their thread and it genuinely looks like a lot of fun; but I have no iPoons, so I may be SoL where it's concerned. And in a more combat-oriented-dungeon-crawly sense, you might poke around Red Rogue and La Mulana as well. You'll see how it can be somewhat relatable once you play it.

You know... I think I'll do a more in-depth analysis of the games in the Design sub-forum; because although I'm not creating one, I do seem to be enjoying quite a number of these treasure-hunter games.
« Last Edit: September 23, 2011, 04:51:51 AM by baconman » Logged

deadZed
Level 0
**



View Profile
« Reply #6 on: September 25, 2011, 10:20:06 PM »

Thank you for that list of games, all do indeed sound interesting  Coffee. I wasnt thinking of Oze, but rather this game (the salvage) that recently got bumped to the top. And yes - you seem to have some knowledge about those types of games, ill be keeping an eye out for that analysis. edit: links: Under the garden and oze - awesome rope physics in that one, but water heavy levels?

Update:
Minimap

Maybe less important, but ive made a little minimap for the hud. Its simply the entire level bitmap drawn out with a different palette, and then moved along with the player and masked so it only reveals the correct parts. Its supposed do represent a sonar or similar diffuse technique rather than a pre drawn map (since that would be odd if the player had). Its therefore blurred a bit so it mostly gives hints as to where there are cavities and important minerals (perhars shop upgrades would make it detect important things).

The inspiration is the motion sensor from Aliens =)

« Last Edit: September 26, 2011, 04:55:03 AM by deadZed » Logged

deadZed
Level 0
**



View Profile
« Reply #7 on: September 26, 2011, 05:09:32 AM »

'splosions!

Ive got the actual destruction of terrain working, when you drill a tile until its health is gone, itll turn into myltiple small blocks (included in the physics simulation) that will fly about and youll have to collect, in order to sell (?) later on. This is how you gather resources, value will be determined roughly by its scarcity (dirt and rock vs rare minerals/metals). Not sure if the type of resource should have a say in the store - item X needs 200 of resource A and 100 of resource B to be purchased. Or perhaps just keep a general currency that resources is sold into and then items are bought with.

And along with that - ive begun blowing terrain up. Havent got any explosion graphics goin yet but all the dirt and dust flying around makes it resonably satisfying so far. Been experimenting with size and damage done, id like to have variations of those. Since blowing terrain up is a very effective way of mining big chunks of terrain, the amount of resources a tile generates when blown up is reduced.


Explosion above is from center of player, this will in the future be from some kind of weapon or perhaps from unstable minerals that are present in the map. Squares with darker borders are collectable resources, the others are dust
Logged

kamac
Level 10
*****


Notoriously edits his posts


View Profile
« Reply #8 on: September 26, 2011, 05:10:58 AM »

Arr.

Nice, is it Game Maker or something else  Waaagh!?

I like that explosion effect  Smiley
Logged

deadZed
Level 0
**



View Profile
« Reply #9 on: September 26, 2011, 12:37:34 PM »

explosions are even nicer in motion =) Its done in flash, i draw by hand in the IDE and code in flashdevelop


Tools aka weapons

Ive drawn some "tools" for the miner to use. Id like them look/sound/described more like mining-tools rather then being purely weapons, but im not doing a very good job! Controls  Hand Joystick will probably be a full 360 aiming with the mouse, and then player movement with ASDW. Jackhammer and chisel "mine" adjacent tiles, jackhammer is more powerful so should have some disadvantage, perhaps only drill downwards?. Spikers fire projectiles, but with low mining power (since you can do it from a far). Thumpers fire a "grenade" projectile that blows up after set time. If this game never gets any combat, it would make sense to remove some of these... More tool ideas? Started on some of the firing/reload animations


Scale will be as seen previously and not big as this, problem is tools are beginning to "stick out" far from the player sprite, might have to scale him down a bit as to still fit on a single tile
Logged

Ashkin
Guest
« Reply #10 on: September 26, 2011, 08:18:25 PM »

May the best mining game win. Beer!
Logged
deadZed
Level 0
**



View Profile
« Reply #11 on: September 27, 2011, 04:45:49 AM »

May there be space for multiple variations of mining games  Beer!Hand Joystick


Updates:


Hand Point Right Got all but one tool animated and the player parts rotating flipping etc. correctly for the aim. Gif shows a few steps, in reality its seamless 360 degree

Hand Point Right Swapped the built int Math.random() for a much faster seedable PRNG (of the XOR flavor). Will probably make use of the seedability later on to be stored along with the map data.

Hand Point Right Rewrote the explosion for more speed where there previously was a small lag. There was too much redrawing/adding/removing stuff so i threw it all in a temporary buffer and did only what had to be done afterwards. The time got cut in half from this! But theres still room for improvement, should probably give object pooling a go again sometime...
Logged

deadZed
Level 0
**



View Profile
« Reply #12 on: September 27, 2011, 10:47:43 PM »

Got a video up (unfortunately only 30 secs) that should give a glimpse of how the late night implemented grenade launching works



Logged

baconman
Level 10
*****


Design Guru


View Profile WWW
« Reply #13 on: September 27, 2011, 11:11:57 PM »

That's a pretty good scale of explosion, it's what I'd expect from an explosive. Lots of popular games even get that wrong. And I like the bounce sound, too.
Logged

deadZed
Level 0
**



View Profile
« Reply #14 on: September 30, 2011, 07:38:58 AM »

 Hand Point Right spent way too much time trying to implement some simple water, but it got out of hand when i realized i have destructible terrain - a big letdown. I just wanted it for decorative purposes. Might revisit that some time.

 Hand Point Right Got almost all tools working with the world, and got me thinking about how one should get about - jepack? rebuilding of tiles? building of ladders? nothing?

 Hand Point Right Rewrote some particle stuff and added perhaps too many of those to the explosions, theres room for optimization here

No more coding this week!  Toast Left Big Laff Toast Right
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic