DarkViGaCi's Recent Forum Activity

  • Hi everyone! I'm starting development on my new game and I want to keep a development log, so you can follow along.

    My game is going to be a side-view tank battle game. The first thing I need to create is a level generator.

    Day 1. Level generator

    I used a pretty straightforward algorithm to create the generator:

    1. When layout starts, I add the coordinates of key points to the array. Each following points has a random coordinates that depends on the previous points (for example: random(-100,100) + oldX ).

    2. Next, I added two Tile Background objects to the layout: one for ground, the other one for grass.

    3. Then, using a loop and a special spline formula, I set positions the mesh points in a way that connects the key points from the array.

    Overall, I got a pretty decent level generator =)

  • Cubic() basically gives a cubic bezier spline where the two middle values are just control points. To have the control points land on the curve you could use Catmull-rom splines. You can find the formula for that online.

    Alternately you could expand cubic out to its actual formula and calculate what values to use for the second and third parameters so the curve lands on the control points.

    Thank you for your advice! Finally I create level generator with spline curve:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's a very simple way to do cubic interpolation in Construct 3:

    However, I need the curve to pass throught every node. There is a third-party behavior "Spline Movement". Using it I make the curve like I need.

    Question is How I can make the curve using spline interpolation in one tick (using loop's and without third-party behaviour)?

  • I can't pass the second level :(

    I really liked the graphics (monochromatic stylization) in your game. I also recommend adding text hints into the first levels to make it easier for new players.

  • It would be great if you first published your game (for example, on Scirra Arcade) and provided a link. Otherwise, how can a review be made for a game that doesn't exist?

  • Thank you very much for yours feedback! It's really important to me. So, I have prepared an update to this template with several new features.

    Added a start and finish rooms. Now a levels have a more complete looks. When the player reaches the flag (located in finish room), they move to another generated level.

    Added a variable maxLevelWidth, which allows you to set maximum width for generating level.

    Added a function that automatically matches the Y-offset of each preset. This allows you to make more complex level geometry.

    Try this on Arcade

    Download this Template

  • Today, I'll show you an extremely simple way to build an unlimited number of levels for you platformer game. So, one of possible way to create level generator is to make several smalls scenes that will be combined into the main level.

    For this template I took the graphics and trap mechanics from the Construct 3 Example Browser.

    How its works

    Layout "Presets". Has several layers, each of which is a small scene containing a tilemap and objects (coins, enemies, traps, etc.).

    Family "Objects". Includes all the objects placed in Layout "Presets". The family is necessary to reduce the number of events and simplify working with objects.

    Dictionary object. On start of layout "Presets", all objects are added to the Dictionary. The name of each key is "object name & layout name & object IID". The content of each key is the objects JSON.

    Layout "Main" is an empty level. When this layout starts, the level is build by a loop and random preset selection. The object data (JSON with position, variables and everything else) is taken from the Dictionary. The coordinate of each object gets additional adjustment using "curX" variable, which means X-offset for current scene.

    Try this on Arcade

    Download template

    Please, upvote this post if you like this. I have a few more ideas for developing this template, but I would like to know if anyone is interested and if you want to see more my templates.

    Tagged:

  • Could this kind of method be adapted to squares rather than hexes?

    If you are using a square grid, then it will be easier for you to using a tilemap, instead of sprites (as in the case of a hex grid).

  • The best way to optimize memory is to animate sprites using Construct 3 tools. Use the Timelines, Mesh deformation and "Tween" behavior wherever possible. If you want more specific advice, take a few screenshots and show how your graphics looks.

  • Do you think there is any way this would work with moving objects that take up multiple hexes such as large enemies or characters?

    It all depends on how many hexes the large units occupy: 2 hexes or 3, or more. It may be necessary to add a function that will filter the hexes through which large units can or cannot pass.

  • I have a paid template, check it out (click Demo C):

    https://www.construct.net/en/free-online-games/random-level-generator-25484/play

    Please be aware that the dungeon layout is fixed (the number of rooms, their locations and entrances). Only the rooms are randomized.

    I have few ideas. I just want to know if my thoughts align with what you did. Did you stored JSON's of each objects on Layout in Dictionary and recreate in runtime?

  • How I can make level like this:

    I tried to use mesh deformation

    https://www.dropbox.com/scl/fi/o156htkng7vacwkjs1b0y/Mesh.c3p

    The main difficulty is in making smooth transitions. O know about "lerp" expression, but I don't know how to apply this. Does anyone have any ideas how to create a level like on the first picture?

DarkViGaCi's avatar

DarkViGaCi

Member since 29 Mar, 2017

Twitter
DarkViGaCi has 8 followers

Trophy Case

  • 7-Year Club
  • Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies