Terraria Clone

  • Is the terrain infinite?

    No this Terrain is not infinite it is a pre-determined size set by the size of the array. Making an infinite terrain would be difficult I think in that you'd have to be creating objects on the fly as they appear on screen and destroying them as they went off screen.

  • Yes but isn't there a way to set up procedural infinite terrain generation. In x axis and y axis. Like in spellbound/terraria..

  • I have not played spellbound, but I have played Terraria and the map size is not infinite it is just quite large. But there is an end to it. As far as setting up an infinite procedural terrain in construct I would not know how to go about accomplishing that. I mean I know you'd have to be destroying anything that goes off screen and creating things on the fly when they came on screen. But that lends itself to the issue of a constantly refreshing world where no changes you make stick. To my knowledge there is no game that has an infinite world that never ends and saves changes made to that world. I don't even think it would be possible. To make an infinite world you would need an infinite amount of ram and storage place to hold all that data.

  • Cool little game. Is the terrain randomly generated?

  • Tekniko the top grass will always be the same but the underground is randomly generated everytime.

  • VictoryX lolpaca Thanks for going into detail in this post it helped me alot, One thing i dont see here is how to make hills or natural type of terrain using the array.

    Im using the procedual method you have shown here but i can not seem to make anything other than flat ground like your demo.

    Would you happen to know how to make some kind of random terrain elevation through arrays? If so it would be pretty epic to know.

  • I never did come about a good way to generate hills or cliffs. It was always just a flat top like in the demo. If you come across a good idea on how to do it please post it.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • VictoryX

    I made a capx with a lot of different approaches here:

  • VictoryX

    In my game Teleblob i went for using the Tilemap object for the terain and after loads of thinking and trying i kind of perfected the use of it "with mining in mind".

    You can see a glimpse of it in this vid

    The nice thing is that the Tilemap setup i use is 8000 x 8000 and it can easily be bigger, but because my game is Online Multiplayer i kept it this large.

    But 8000 x 8000 is still pretty large.

    The most difficult thing with the tilemap was that i could not use a array to store all tile data.

    What i did was use the tilemap image blocks as animations.

    Lets say the tilamap image uses 15 tiles of the same rock, but each a little further destroyed.

    Then when mining, i set (estimated) after 0.3 seconds the tile one number further down.

    From Tile - To Tile (takes 0.3)

    Tile 15 = 100% block

    Tile 14 = 90 % block

    Tile 13 = 80 % block

    Tile 12 = 70 % block

    Tile 11 = 60 % block

    Tile 10 = 50 % block

    Etc

    This enables the animations of the blocks while using the Tilemap.

    The time it takes to destroy them from 100% to 0% = 0.3 seconds x the amount of tile images used. (seconds can be altered per block)

    Especialy for online games this is neat, because it keeps the cpu low so more frames are left over for multiplayer data to be send.

    Hope it makes a little sence what i did.

    (I tested a map of 8000x8000 sprites and it was killing.)

    With this i easily get 60 fps on my pc.

  • VictoryX can you show me how to generate such content as underground randomly? Maybe pm me with some sample "code" ?

  • oh forgot to mention that i like the idea and the game is working fine for me (chrome on windows)

  • Awesome. It took me a while to realize how to dig

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)