Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Destroyable environment without tiles. [DISCUSSION]  (Read 3297 times)

0 Members and 1 Guest are viewing this topic.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Destroyable environment without tiles. [DISCUSSION]
« on: July 05, 2011, 02:04:50 pm »
I am not 100% sure if I put this in the right forum but here it goes.
I have had this on my mind for a long time and tried to figure out logically how to do it. I am not interested in actually implementing it but rather how to. This topic is if anyone interested in starting a discussion on how to achieve this functionality. So I urge, no implementation details or anything like that. Just plain mind game. If you guys are interested of course.

A sandbox game where you can destroy the environment(ground, objects, etc.) and it have an effect on the game world. For a quick example of what I mean then Minecraft. But Minecraft has the easiest way to implement this. Using tiles. Infiniminer which goes a bit more advanced on this subject used voxels. Though it still had that squarish look to it. Which I want to avoid. There is no requirement that the maps are generated procedurally but it would be a bonus if the system would support that.

So far what I've come up with is faking it with tiles. So let's say we have a grid of tiles. And we hit one of the tiles with a pickaxe. Where we hit with the pickaxe we add a vertex a bit inside so it looks like the tile has collapsed a bit inward. The problem is when to remove the tile. Because when removed it will get back to that squarish look again. Plus some other game design problems come to mind if you just think some extra steps forward.

Anyway my basic idea is "when hit" deform the tile.
Anyone else interested that got suggestions/ideas?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Destroyable environment without tiles. [DISCUSSION]
« Reply #1 on: July 05, 2011, 02:13:59 pm »
Couldn't you only remove the tile if it has been completely or almost destroyed? Then it wouldn't disappear magically.

While damaging a tile at the top, you could also transfer a part of the damage to tiles below/around it. If you create a hole in the tile and continue to hammer, the hole will be expanded to the tile behind it. Like this, the next tile is already distorted when the first one is removed, so the removal doesn't lead to a squarish look.

Depending on how realistic you want to do it, you have to choose a trade-off between authentic physics and a simple, fast implementation.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Haikarainen

  • Guest
Destroyable environment without tiles. [DISCUSSION]
« Reply #2 on: July 05, 2011, 02:14:53 pm »
Have you considered Worms-style? Just load the destroyable tiles from a map into a big image and chip that with circles/whatever.

An idea i had was to use hexagons, wich when hit broke down into several smaller hexagons(and half hexagons to fill out empty space).. Its not as squareish as tiles, even though you see a pattern in it.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Destroyable environment without tiles. [DISCUSSION]
« Reply #3 on: July 05, 2011, 02:33:02 pm »
Quote from: "Haikarainen"
Have you considered Worms-style? Just load the destroyable tiles from a map into a big image and chip that with circles/whatever.

Well yeah but I have no idea how cube images work(I am thinking for 3D so for it to work I would have to use 3D images)
But that would be pretty good if you could get it to work in a runnable performance. On hit remove pixels from an image. Actually not bad. And absolutely perfect for a 2D version like Terraria.

Quote from: "Haikarainen"
An idea i had was to use hexagons, wich when hit broke down into several smaller hexagons(and half hexagons to fill out empty space).. Its not as squareish as tiles, even though you see a pattern in it.

Hmm the breaking the tile down to smaller parts when broke is interesting. Not the hexagons but the fact that if we say for the easy case: We have a cube tile. We hit it so we divide it down to 9 cubes on one side and remove the cube where we hit. It would let us form our landscape a little better.But as you said there would still be a pattern.

It would be nice if we at the end result could form smooth landscape like this:

While a tiled landscape would give us this:


So you could say what I am looking after is vector graphics instead of raster graphics ;)
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Haikarainen

  • Guest
Destroyable environment without tiles. [DISCUSSION]
« Reply #4 on: July 05, 2011, 03:28:17 pm »
Quote from: "Groogy"
at I am looking after is vector graphics instead of raster graphics ;)


Ah i totally missed the 3D-part.
I cant remember the name of the method buth i think it is called CSG extraction/cutting or something like that. It basically creates holes in 3d-objects. So for an explosion you would just csg extract a sphere out of the world. I think that is what faction uses for their destroyable terrain.

The methods really depend on your resulting gameplay experience, like if you have brickwalls etc, apply physics and make all the bricks an object, bound togheter as a whole before impact. Roofs could also be separated into different objects.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Destroyable environment without tiles. [DISCUSSION]
« Reply #5 on: July 05, 2011, 03:32:06 pm »
Well the goal is to create a sandbox game. So if we focus on ground/dirt walls and not objects. How would this be achieved in a realistic way? We could look at how it kind of works in Sim City to shape the landscape. Add a "pressure" at one point lowers a tile and the others around it follow by slopping down. But how would one create caves? Would that actually work?

This resembles kind of what you proposed Nexus.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Waterlimon

  • Newbie
  • *
  • Posts: 7
    • View Profile
Destroyable environment without tiles. [DISCUSSION]
« Reply #6 on: July 05, 2011, 05:27:26 pm »
Do the break-into-many-parts, but instead break the cube in 8 sub cubes, and check wich ones will be affected and break those down too until you have the desired level of accuracy, and then remove some minicubes.

That would work, you could build the terrain using huge cubes underground and over ground you could break them down to make it smooth. Also you should not render them as cubes, but do something to cut the edges on sides/corners with no adjacent cubes.


Or, you could make the terrain using really-low-quality spheres but that might be ugly and/or lag.
This sententace makes me more unique. Too lazy to upload avatar. Nobody reads usernames.

Haikarainen

  • Guest
Destroyable environment without tiles. [DISCUSSION]
« Reply #7 on: July 05, 2011, 06:47:53 pm »
Quote from: "Waterlimon"
Do the break-into-many-parts, but instead break the cube in 8 sub cubes, and check wich ones will be affected and break those down too until you have the desired level of accuracy, and then remove some minicubes.

That would work, you could build the terrain using huge cubes underground and over ground you could break them down to make it smooth. Also you should not render them as cubes, but do something to cut the edges on sides/corners with no adjacent cubes.


Or, you could make the terrain using really-low-quality spheres but that might be ugly and/or lag.


That was just my thought when i wrote that actually :)

On the spheres bit i really dont think that would neiter lag or be ugly, if you do it right. It would create a less cubic-like enviroment, still with a pattern, but at least not ... minecraft. :)

Agent

  • Newbie
  • *
  • Posts: 1
    • View Profile
Destroyable environment without tiles. [DISCUSSION]
« Reply #8 on: July 30, 2011, 11:40:53 pm »
Perhaps read a bit about how the original Red Faction game did it, like on wikipedia: http://en.wikipedia.org/wiki/Geomod

 

anything