Get Me Out (comrade Gamedev) Mac OS

broken image


Thanks again for reading and for taking the time to get in touch! On Sep 3, 2016, at 4:25 PM, Johannes notifications@github.com wrote: Preface. I am a Computer Science student and have been working my way through your Multiplayer Game Programming book. The entire operating system is a mess, from using the command key, to single button mice, to finder being almost as bad as Windows Explorer. Weird window management system, godawful task bar system, etc. Just using the operating system is enough to drive me nuts. Finally, the big one, planned obsolesce. Write a program using C and Carbon? Game engines are tools available for game designers to code and plan out a video game quickly and easily without building one from the ground up. Whether they are 2D or 3D based, they offer tools to aid in asset creation and placement.

I'm working on a Mac with OS X 10.5.7 and a fresh XAMPP 1.0.1 install. XAMPP gives your OS X a complete Apache, MySQL and Perl/PHP installation to work with. With it, you can develop on your Mac with a complete web server. (Sure, Mac comes with most of this stuff built in, but XAMPP is really nice and allows you to have your Mac web services turned off for security.)

XAMPP also comes with phpMyAdmin for managing your MySQL server through a web page. I find phpMyAdmin to be awesome for most of what I do with a database. Sometimes I need to revert to command-line for large datafiles and stuff, but I'd say 99.9% of the time I can use phpMyAdmin for what I'm doing. I ran into a problem with phpMyAdmin trying to view a database table that was imported from an Excel export. For some reason, the phpMyAdmin page is just plain white – making me think there was some web/parsing/display problem involved. I needed a different way to view the DB. For this kind of thing I hate the command line. (The line wrapping…blech!)

MySQL makes a set of GUI tools, too. But when I installed them, and tried to connect to my DB, I kept getting a 2002 connection error code; something like:

ERROR 2002: Can't connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock' (2) Violent bird hunt mac os.

The normal solution to something like this is you have the wrong username/password or you cannot connect to the server. But that is not always the case.

The real problem is that the GUI tool could not use mysql.sock – which didn't even exist. XAMPP's installation of MySQL uses a different socket file under /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock. This is configured in XAMPP by the /Applications/XAMPP/etc/my.cnf file.

NOTE: edited with a simplerpermanent method

First thing I did was make a soft link to the my.cnf file in /etc. This makes the my.cnf accessible from a more 'normal' location on a Unix system (which Mac OS X is a flavor of) by making a new file that actually points to the XAMPP one in it's original location.

ln -s /Applications/XAMPP/xamppfiles/etc/my.cnf /etc/my.cnf

Then I made a soft link to the XAMPP mysql.sock file.

ln -s /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock /tmp/mysql.sock

If you click the 'More Options' twisty on the connection dialog, you will see a cryptically labeled field called 'Connect using socket:'. Put the path to your mysql.sock file in that field. Mine was located at

/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock

in a standard XAMPP installation. (MAMP will be slightly different).

Out

Here is a screenshot:

After that I was able to connect with the MySQL Adminstrator GUI tool and Query tool.

This may save you some trouble if you're trying to do the same thing.

24 hours of game dev in Rust

A self imposed game jam trip report

Me

  • Michael Shaw
  • Years of developing games in Scala
  • 24 hours of Rust experience

Why

I started off building big, learning slowly

Most of my ideas are bad
'Require Iteration'

Learning out they're bad in 24 hours
is much cheaper than 3 months

Scala

Might be the best game jam language in existence

  • Performance is easily good enough
  • Type safety + terse (fast dev)
  • Fast incremental compiler
  • Functional programming with escape hatches

Painful long term

  • Distribution & garbage collection woes
  • High cost abstractions hard to distuinguish
    from low cost ones
  • Clean code murders the GC
  • GC friendly code is nasty

Rust

  • Expressive (but not terse), fast, no GC
  • Tree based ownership over structural sharing is fine with games
  • Zero cost abstractions (for the machine)

Can you make it 'Game Jam' friendly though?

Can we create a layer of machine inefficient,
developer productivity based shortcuts?

Something you start with,
and phase out when you need speed ..

What

Glium & Glutin overview

Game jam style engine design

A smidge of game design

Building a tiny game

Cheating

I read https://doc.rust-lang.org/book/ beforehand

I only counted development.
There were a few hours planning with what to build.

24:00

Thievery and triangles

Glium

https://github.com/tomaka/glium

Safe OpenGL without the state machine.

  • Forget about glEnable/glDisable/glBind/glUnbind ..
  • Don't look at the issue count on github, everything is fine

Target

What we're drawing on (window, or off screen)

vertex_buffer

Vertices that we want to draw (usually triangles)

program

A pair of GLSL programs/'shaders'
Vertices + Uniforms in -> Coloured pixels out

uniforms

Shader program state
(textures, colors, camera transforms)

Pretend the (!) isn't there and that it's just a struct.

That ! is saving you from 24 years of OpenGL's legacy

When you see a ! you're exchanging a few hours of runtime trial and error for a runtime error on program start

Uniforms

Shaders

Becomes

Mac OS X Notes

Demand a core profile

Make your shaders 3.3+

Glium examples are really easy to run (steal them)

Print input events to get familiar

Glutin

https://github.com/tomaka/glutin

Cross platform:

  • Window Creation
  • Input Events
  • OpenGL Context Creation

23:00

An ounce of organisation

Paying the piper

An hour spent learning Rust's module system

You know what I said about stealing everything ..

Throw it out and add it back line by line

lib.rs

Forget your managed namespaces

module directives form a tree

Named pointers, not namespaces

Halfway between namespaces & include directives

22:00

An ounce of organisation

Piper needs a brand new car

An hour spent battling glium Types

All the examples are one function, so there's no examples of:

I'm pretty sure I shouldn't be passing around a GlutinFacade.

An hour later I find ..

Because I'm new at Rust :-/

21:00

Game jam style rendering

Quick & Dirty

2D sprites positioned in 3D (more than Z order)

Quads only, in one vertex format

At most a few batches per frame

Dev performance, not machine performance

'Flash' guys in the middle with per vertex colors

One fat vertex format

color allows us to flash guys white if they get hit
or red if they're hurt

normal allows us to add lighting if we have time

(Poorly) recoloured sprites for different teams

Texture Arrays are your friend

Great for sprites

Run out of space?

Add another layer

Different sides/factions?

Add layers with recoloured versions

image

https://github.com/PistonDevelopers/image

The last image library you'll need

Getting Quads back

OpenGL doesn't have quads

We can just duplicate bottom-left and top-right vertices

Efficient* Quads

*Developer efficient, embrace #Derive(Copy)

20:00

Generating geometry: Walls and Floors

'Base Anchored Wall'

'Smart' quad tesselator understands desired pixel scale and texture sizes to give consistent pixel density

Rendering becomes

18:00

Cameras and Tiles

cgmath

https://github.com/brendanzab/cgmath

All the vecs, mats, dots, crosses and inverts you need for a game

Pixel Perfect Camera

Blending & Depth

16:00

Everything's wrong and I hate the world

Assumed my camera creation was wrong, and spent an hour debugging it

Example shader had matrix multiplication reversed

15:00

Interaction

Input Handling

We need to remember a few things between frames

Mouse Picking

From windowed mouse coordinates to world objects

Get Me Out (comrade Gamedev) Mac Os Catalina

In our main loop

12:00

Hey, you said there'd be games you lying bastard ..

Game in 12 hours anyone?

Set your expectations low

No, lower than that, like real low

Think

Tile laying
&
Mountain climbing

Grom, The Mountain God

Good? Evil? You're the big stone head

Help everyone up?

That's just lemmings

Make sure nobody gets up?

That's just weird tower defense

Get the chosen one to the mountain top

> 1 You Lose .. < 1 You Lose

Who's the chosen one?

Clearly the guy that made it

Climbing is dangerous

11:45

Let's reverse things

9:00

First Steps

Get Me Out (comrade Gamedev) Mac Os Download

#[derive(Clone,Copy,Debug,Eq,PartialEq)]

Simple & Inefficient
Why borrow when you can copy? (don't answer that)

Disclaimer

This is not idiomatic Rust, these are the fever dreams of a Scala developer who can't even remember what life is like without a garbage collector

Game State

Tiles

World Gen

Rendering it

7:00

Placing tiles

5:00

Ears for sound

  • Simple cross-platform sound
  • Needs OpenAL & libsndfile at runtime
  • Works cross platform (unlike some others)

4:00

Now with climbers

Climbers

Rendering climbers

2:00

ClimberS, it's ugly code time

Movement Rules

  1. If you're at the stone head, climb in
  2. Go somewhere new that's not down
  3. Go somewhere new (that's down)
  4. Wait (and reset where you've been)

Travellable Locations

Everything would be a stack allocated
lazy iterator if I was better at this

00:00

Everybody loves chiptunes

https://soundcloud.com/eric-skiff/come-and-find-me

Eric Skiff

Springs for smoothness

Attach them to everything

Parallax clouds

Realistic head bob

Get Me Out (comrade Gamedev) Mac Os X

'Dynamic' crowd sounds

3D climbing depth

Get Me Out (comrade Gamedev) Mac Os 11

Thanks for listening

Engine source is up at
https://github.com/MichaelShaw/rust-game-24h

Game is up at
https://github.com/MichaelShaw/grom





broken image