Skip to content

Tutorial X: the roads between the cities #1

Open

Description

@EtienneBruines

So, at some point, it'd be nice to connect cities by means of roads.

The back-end knowledge is easy. Allow passengers to use those roads, also not much of a problem.

But I am wondering how to render the roads. I mean, we might have a road-texture (.png or something) which is 10 units long. If we wanted to create a road that's 100 units long, we somehow set OpenGL to repeat the texture (not sure how again? But I'm sure I can look that up). Or should we physically have 10 of those "10 units long" road-pieces (also in the game-logic), and let them be "connected"?

We would need rotation support, which will be added soon (I hope), if we want to add diagonal roads.

Thoughts? Any possible solutions? Any possible difficulties anyone foresees? @paked do you have anything to add on this?

Activity

  1. paked commented on Apr 11, 2016

    @paked
    Member

    The way most games would tackle this problem is with tilemaps. So you have a lot of small images, that get placed on a grid in a specific order make up the map.

    This kind of thing:
    http://www.ludumdare.com/compo/wp-content/uploads/2008/12/road_tiles.jpg

    Unfortunately, our tilemap system is broken/non existent anymore. So we're going to need to fix that. EngoEngine/engo#162.

  2. EtienneBruines commented on Apr 11, 2016

    @EtienneBruines
    MemberAuthor

    Yeah, I was looking for a way without tilemaps; but I think that's probably the hardest way to do things (and why they have only been doing it the "new" way for a few years).

  3. paked commented on Apr 11, 2016

    @paked
    Member

    @EtienneBruines What do you mean by the "new" way?

  4. EtienneBruines commented on Apr 11, 2016

    @EtienneBruines
    MemberAuthor

    I mean being able to draw a straight road between points (10, 10) and (123, 432), render it and then use it in game logic.

  5. gerbenjacobs commented on Apr 26, 2016

    @gerbenjacobs

    How about a regular drawn line, which will be a simple coord A to coord B and will introduce simple shapes (if those are in the engine)

  6. paked commented on Apr 26, 2016

    @paked
    Member

    @gerbenjacobs Not quite yet, EngoEngine/engo#131. But that is a good idea!

  7. EtienneBruines commented on May 14, 2016

    @EtienneBruines
    MemberAuthor

    Fixed in the playground branch.

    @gerbenjacobs I've indeed implemented them as such (since EngoEngine/engo#131 was merged a few days ago). 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions