• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
neo72

Same bridge-model different lenghts - how did they do that

8 posts in this topic

Hi

 

I have played a game (Sid Meier's Railroads) and a few days ago I installed it again to relieve some fun memories.

 

While I was playing I noticed that when my railroad crossed rivers or a ravines then the game would create a bridge and it is this part which have me puzzle:

 

The bridges were never too short no matter how wide the gap were the bridges just got longer to neatly (I dare say) fit the gap.

 

If anyone wants to bother having a look then there is a tons of screenshots on google.

 

Now to my question:

 

How was this made ?

 

My own guess is (and I'm not a programmer, which is why I'm asking you !) that the developers made the bridges in three segments: 

 

1. a start segment

 

2. a middle segment which is expandable

 

3. an end segment

 

Here is another thing I don't understand:

 

How the the program knows:

 

1. how many middle segments to add

 

2.how pick the most suitable type of bridge for a particular gap

 

http://www.gbase.de/uploads/ci/shots/Sid-Meiers-Railroads!_b_55738.jpg

 

http://storeimages.impulsedriven.com/product_gfx/04xx.jpg

 

http://tjstatic.com/multimedia/2011/07/sid-meiers-railroads-pantalla-1.jpg

 

I hope someone would like to enlighten me.

0

Share this post


Link to post
Share on other sites

If The Bridge was layed in in segments as the span got longer or shorter, then you would Notice a repetative visual sequence.

 

Most likely what the programmers di was to "Scale" the model image to fit the scene.  To help you visualize this Consider the following..

 

  Model Bridge >    <____>  ScaleX1.25 <_____>  ,  ScaleX1.50 <______>,  SscaleX2.0 <________>

 

See it getting Longer ?

2

Share this post


Link to post
Share on other sites

Its segments. You can blatantly see in the second image you linked to. The two short ends arches are identical to the ends of the long arch in the middle. There's just three sections to this model, either end and the middle bit and the middle bit is probably quite a narrow section that repeats over and over to get the desired length.

 

Scaling a single model would not even remotely produce the effect this software demonstrates.

1

Share this post


Link to post
Share on other sites

It's the multiple-mesh version of sprite slicing.  Define endcaps or corners that don't scale, and then a center region that scales or repeats as necessary.

 

To get perfect fit, you could place the two endcaps, and then calculate the world-space distance the bridge needs to fill, and create repeating elements that have a small scaling range to let them fit any dynamically-sized gap.

 

Or you could skip the scaling part and just clip the ends of the bridge into the terrain a little bit.  There are several solutions depending on how you've designed the "world" to work.

0

Share this post


Link to post
Share on other sites

Disclaimer: I don't know WTF I'm talking about !

 

Hi

 

First of all: Thank you all for taking your time to reply

 

@Poigahn

 

It is hard to give a comment on your reply as I'm not sure which of the images you're refering to, but my best guestimate is that you're refering to the yellow brick-like structure.

 

@Aardvajk

 

You also seem to have set your sight on the yellow brick-like structure.

 

@BCullis

 

Thank you for the link - I'll admit I get a little dissapointed when I discovered it was about Flash, so I did a search, but in vain as I couldn't find any site which could privide me with an explanation I was able to comprehend (I don't blame you, but instead my mom and dad !)

 

Anyway, since you all seem to somewhat agree on how the yellow brick-like structure was made (and I have to agree too), I would then like to point your attention the the truss bridge found in two of the images.

 

This is not made with the same technique as you have described in the above.

 

My guess is that this bridge is made from a set of predefined rules:

 

(psudo code)

 

While laying tracks

 

If encounter a depression (ravine or river)

 

Then start with a steel truss bridge with three bridge segments (ie. a start, middle, and end segment) to close the gap - did it work ?

 

if yes then continue to lay track

 

else

 

Then start with a steel truss bridge with three bridge segments (ie. a start, 2 x middle, and end segment) to close the gap - did it work ?

 

if yes then continue to lay track

 

else

 

Then start with a steel truss bridge with three bridge segments (ie. a start, 3 x middle, and end segment) to close the gap - did it work ?

 

if yes then continue to lay track

 

else

 

Then start with a steel truss bridge with three bridge segments (ie. a start, 4 x middle, and end segment) to close the gap - did it work ?

 

if yes then continue to lay track

 

else

 

Then start with a steel truss bridge with three bridge segments (ie. a start, 5 x middle, and end segment) to close the gap - did it work ?

 

if yes then continue to lay track

 

else

 

add an "elastic" bridge segment and when there is enough left add another steel truss

 

(psudo code END)

 

There are most likely a few more parameters, but the one I just described in my psudo code is the most obvious, based on what I can see in the images.

 

Does anyone of you have anything to add (I could be the case that I have gotten it all wrong, which certainly wouldn't be the first time !)

0

Share this post


Link to post
Share on other sites

I'll admit I get a little dissapointed when I discovered it was about Flash, so I did a search, but in vain as I couldn't find any site which could privide me with an explanation I was able to comprehend

The flash tutorial was just a handy example of what I went on to describe in the rest of my post.  Fixed-size "cornerpost" elements of a visual object, filled in with scaling-friendly (or in the case of meshes, repeating-friendly) filler elements, so that you can fit any arbitrary dimension requirement.

 

Which is what your pseudocode does, kind of, only it wouldn't be quite so ...voluminous.  Just write an algorithm that looks at the distance you need to cover, determine how many repeating elements it will take to fill that gap, and place them.

0

Share this post


Link to post
Share on other sites

Which is what your pseudocode does, kind of, only it wouldn't be quite so ...voluminous. Just write an algorithm that looks at the distance you need to cover, determine how many repeating elements it will take to fill that gap, and place them.

 

Disclaimer: I don't know WTF I'm talking about !

 

Hi

 

Thank you for your reply.

 

As I read and understand your algorithm it would continue to add middle segments until it had nearly closed the gap and just slap on an "end" segment - if this is true then some of the bridges would look rather strange and really long - some of them might even end up defying every book that been written about load-bearing capacity in bridge spans due to their huge distance between their pylons !

0

Share this post


Link to post
Share on other sites

In the first pic you posted they split up a long span into more than one bridge section, with a small bridge followed by a gap followed by a larger one. There is a column at the end section of each bridge. You can do that to add more columns to a bridge. There's no reason columns can't go down into the river you are crossing.

 

Note that the bridges aren't always straight either, it looks like they are following a spline which complicates things a bit more (you have to place the bridge section on a trapezium like shape rather than a rectangle).

 

EDIT: You probably don't want to have new columns destroying existing buildings, but since it is a Sid Meier game, I will recall my anecdote about how I built some buildings in one of my cities in Civ IV which already contained the pyramids, and the pyramids moved afterwards, over a river no less ;)

Edited by Paradigm Shifter
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0