Skip to content

Instantly share code, notes, and snippets.

@samuelfvlcastro
Forked from brendanzab/handy_links.md
Created August 20, 2014 12:39
Show Gist options
  • Save samuelfvlcastro/7b4f96ab9472342ee632 to your computer and use it in GitHub Desktop.
Save samuelfvlcastro/7b4f96ab9472342ee632 to your computer and use it in GitHub Desktop.

Key sources of inspiration:

  • M. C. Escher
  • Shaun Tan
  • Ghostpatrol
  • Nifflas (Knytt, Knytt Stories)
  • J. R. R. Toliken (Maps, history and languages of Arda)
  • Jon McNaught
  • Birchfield Close, Pebble Island, Dockwood)
  • Tom Gauld
  • Hayao Miyazaki/Studio Ghilbi
  • Dinatopia
  • The Legend of Zelda: A Link to the Past/The Wind Waker
  • glfw-rs
  • gl-rs
  • cgmath-rs
  • color-rs
  • noise-rs
  • gfx-rs - Todo. Data-oriented rendering engine.
  • pd-rs – Todo. Wrapper for pure data. gist
  • bullet-rs – Todo. Wrapper for the Bullet physics library.
  • mia – Todo. Embeddable, concatenative scripting language

There are many experiences I've had in Dwarf Fortress that were particularly vivid. A polar bear stalking my woodcutter, but evading my warrior across the arctic tundra. A master engraver carving the story of a dwarven child who went mad. Purple gas saturating the grave room and leaking into the halls when my dwarves were being massacred by kobolds. Good friends celebrating in the great room, drinking while admiring the mist (the fortress was built into the back of a waterfall, and mist makes dwarves happy). The clumsy blacksmith and shy carpenter who lived in their corner of the mine, happily married and rarely taking food with the other dwarves. The cats. The dragon.

oscilloscope

At its heart, the graphics pipeline is simply a configurable data-flow network. The main input of the network arrives as a stream of vertex descriptions, and additional data can be provided in various slots, which are constant during a rendering pass: uniforms of basic types and samplers (textures with some attached logic). After some processing steps, the final output is one or more raster images.

LambdaCube 3D: Motivations and background

Be curious. Read widely. Try new things. I think a lot of what people call intelligence just boils down to curiosity.

Aaron Swartz

I've mentioned this many times in this subreddit since this question comes up often (i suppose this should be added to some FAQ?): scripts should say what to do, not how to do it.

Example: to fire a rocket from the player towards a target (f.e. another entity or some general direction pointer by the mouse/controller):

  1. the game engine should provide functionality for calling script code when a key is pressed (or action is commanded, if you want to generalize this). In the rocket case assume some script code is executed when you press the Space key.

  2. the script code for the "fire rocket" action (f.e. pressing the Space key) will need to create a rocket entity, attach it a model, repeating sound effect, particle system, etc (you'll probably have some helper functions that do the gruntwork for these and your scripts will simply call something like "spawn rocket")

  3. next it'll obtain the rocket starting point and direction, set up physics motion. Finally it will attach some script code/callback for when a collision with something occurs

  4. after that the script ends and the rest is up to the engine: moving the rocket, handling collisions, spawning new particles for the particle system, playing back the repeated sounds, rendering the rocket model, handling the resource stuff (model, textures, sounds, etc), visibility, pathfinding (for a homing rocket or whatever), etc.

  5. at some point the rocket will collide with something. In that case, the script code/callback set up above will be executed. That script will do something like asking the engine to play back an explosion sound, spawn another particle system (for smoke, fire, etc), destroy the rocket entity and send a "damage" message to nearby entities (having a message system for your entities also help so that entities can send arbitrary messages to each other either by knowing about themselves, using some form of radius around a point and/or having a common area tag and id).

  6. the engine again handles the playback, sound mixing, particles, etc

Note that between #4 and #5 there is zero time spent in scripts (at least as far as the rocket is concerned).

Of course for prototyping you may want to expose more low level stuff in the scripts (f.e. check against two items colliding) but these must be removed as soon as the prototype works and be implemented in the engine side.

badsectoracula's comment on the question: "How much of a game engine should be handled by the scripting language?"

Peter Jackson's portrayal of Minas Tirith

Ah Minas Tirith, my old pet peeve … as much as I love the movie I have to say I hate the movie version of the city. First, it looks way to small to accomodate its population. Secondly, where are the surroundings? Where are the taverns and shacks of the poor that should sprawl around the city walls? Where are all the farms that should stretch around all the land surrounding the city? They were even mentioned in the book! It took the orc army several days to burn down all the farms and homesteads! Why ist there only a plane of grass? Don't they need to produce food? Where? How? This city and its surroundings look so empty and sterile :/

Phew, had to get that of my chest.

Edit: Take this plan of medieval brugge for example! You can clearly see all the land around the city cultivated

zorfmorf commenting on [Render] Minas Tirith from the Lord of the Rings

Conversation from irc.mozilla.org #rust


bjz     hey um, are you fellows familiar with data-oriented design in regards to
        game engine architecture?  
        just wondering if it's worth playing around with in rust, or whether
        rust has solved the problems that caused its adoption by a subset of the C++ devs.
        
@brson  bjz: I am not familiar, but am interested any any game engine
        requirements because Rust has great features for multimedia and games 
        
Yoric   If there are any good articles about this, I am interested in reading
        them, though. 

bjz     basically it's all about thinking about streams of data, as opposed to
        individual objects

@brson  bbl, would like to hear more about this

bjz     http://gamesfromwithin.com/category/data-oriented-design    
        http://www.slideshare.net/DICEStudio/introduction-to-data-oriented-design
        https://docs.google.com/present/view?id=0AYqySQy4JUK1ZGNzNnZmNWpfMzJkaG5yM3pjZA&hl=en   
    
z0w0    that sounds a bit like reactive game programming    

bjz     basically as opposed to traversing trees you pack things together in
        arrays of memory. but I'm not hugely experienced in it.
        It has avantages insofar as you can do operations in batches, and send
        data off to the gpu in blocks, as opposed to all fragmented  
        
@nmatsakis  bjz: we have not solved that problem whatsoever 
        I am mildly concerned about this    
        but decided not to think about it for the time being :) 
        it seems like the only solution I can see is to provide features that
        allow you to change the layout of structs in a flexible way   
        I guess that we do better than c++ in this regard in the sense that, in
        principle, you could probably write your code with traits to gain that
        flexilibty but I tihnk it'd wind up very ungainly and you'd never do it    
        that is to say, you'd have to plan ahead way more than you ought to 
        
bjz     mmk

@nmatsakis  basically it seems to me that addressing this problem correctly kind
        of runs counter to one of Rust's design goals, which is giving you a
        clear idea of how data is laid out in memory and what the compiler will
        do to access it   
        but anyhow  
        there are some languages that mix GPU programming and C and have
        addressed this in interesting ways...maybe if we ever go in that
        direction we will copy them 
          
z0w0    data-oriented design sounds like it would work fine with rust
  
@nmatsakis  so, you can do it   
        what I meant is that: if you want to switch from an array-of-structs to
        a struct-of-arrays it's no less painful than in C++    
        
bjz     but is it worth it? is the question.   
 
@nmatsakis  I tihnk to "support" data-oriented-design, you would want to have
        some abstraction that lets you switch this trivially  
        like, you define a "table"  
        and you can view it as though it is an array-of-structs 
        or struct-of-arrays 
        whichever is more convenient for you at the time  
          
cactuss is it a matter of the language removing levels of indirection for
        performance?  

bjz     nmatsakis: could you do something with language extensions - ie. macros?
        I'm not too familiar with that side of things. 
        
z0w0    won't data-orientated design need a lot of vectors? 

bjz     cactuss: it's about managing game entites in groups so that you can pack
        data together efficiently, and transfer it around. And also apply batch
        operations to single blocks of data as opposed to jumping around traversing trees. 
        at least that's what I've gleaned so far
         
z0w0    it would need a dynamic vector for each x position, angle, etc. that is
        if the game map didn't have a fixed number of objects.  
        or am i interpreting this wrong
        
bjz     z0w0: quickly skip through from slide 12:
        http://www.slideshare.net/DICEStudio/introduction-to-data-oriented-design 
        
@nmatsakis  bjz: I imagine some sort of language extension could be helpful,
        yeah syntax extension  
         
bjz     I'll have a play around, I just thought I'd consult the 'experts'   
        :)  
        It's kind of cool to think of the world state as data, and having it pass
        through a 'filter' that transforms it ie. the laws of the game world
        
@nmatsakis  I've never really done anything w/ D-O-D, I've just heard it
        mentioned as something that can be very important so I have no real idea
        what "supporting" it means   
        but I'd like to know more   
        I think it could be important for Servo too—those kind of approaches
        might be well-suited to the DOM, for example.  
        well, it'd be tricky.   
        but potentially :) 
         
bjz     I'm still green to it too. And I don't want you guys to have to support
        every single person wanting a feature.  
        And for all I know game devs folks might have moved on. Most of these
        articles were written a couple of years ago.
        You know how tech fashions are :P 
        
bjz     Seeing as most folks are using C++, most of the literature, research,
        and pratices out there is directed towards it. It'd be interesting to
        see how we could apply Rust's specific strengths to possibly bring
        something new to the table.  
        But I don't know enough yet to do that, I still have tons to learn. ;)
        Still need to figure out how to get opengl up and running, hehe. 
        (ie. opengl with rust)  
        
Yoric   bjz: We are looking for students to write a small 3d game with Rust
        (or port an existing one). We will be sure to post any interesting results.  
  
bjz     Yoric: I've got some basic bindings for GLFW on github  
        might be of use 
bstrie_ Yoric: minecraft seems simple enough   
 
bjz     oh gosh, every man and his dog is cloning minecraft these days :P  

Yoric   :) 
 
bjz     Yoric: https://github.com/bjz/glfw3-rs  
        Yoric: the coding might be abit poor in places, so be warned. I did get
        nmatsakis to look at it though. 
        
Yoric   thanks

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