Skip to content

Instantly share code, notes, and snippets.

View Lokathor's full-sized avatar
🌴
Workin' on Rust Stuff

Lokathor Lokathor

🌴
Workin' on Rust Stuff
View GitHub Profile
@Lokathor
Lokathor / stm-ircbot-demo.hs
Last active April 30, 2017 08:45
A demo of a simple multi-threaded IRC bot in Haskell using stm and async.
{-# LANGUAGE NondecreasingIndentation, OverloadedStrings #-}
-- This demo program is placed into the Public Domain.
module Main where
-- imports are grouped by the package they come from
-- base
import Control.Monad (mapM_, forever)
{-# LANGUAGE Safe #-}
-- this demo is placed into the public domain.
-- base
import Control.Monad (forever)
-- ansi-terminal
import System.Console.ANSI
main = do
//! A module for creating collections of mutable references from collection
//! objects. This allows you to edit more than one location within a collection
//! at the same time. This is totally safe to do as long as you don't re-shape
//! the collection while you do it (which the lifetimes ensure). It's basically
//! a generalization of the `split_at_mut` concept.
use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;
// Released to the Public Domain via The Unlicense.
//! Holds PRNG related types and operations.
//!
//! We're not using `rand`, because we don't need no instructions to know how to
//! rock.
//!
//! # PCG Stuff
//!
//! The PRNGs here are all generators from the [Permuted Congruential

Why can’t you use std for game dev?

(I speak as a hobbyist who watches a lot of game dev talks and tinkers with stuff in his garage but who doesn’t work in the AAA space or anything like that)

The short answer is that you can use std for some game dev, but not all of it.

The long answer is that among the many ways to break down and categorize games there's one way to split things that I'll focus on for the moment. While attempting to be charitable to everyone involved, we'll call it "developing a game using an engine" vs "developing a game engine".

If you are developing a game using an engine then the non-rust version of that story is gonna be Unity (C#) or Game Maker (Pythonic scripting lang?) or RPG Maker (Ruby?) or things like that. The rust version of that story is things like Piston or GGEZ. Might be 2d, might be 3d, either way it probably doesn't push the hardware to its limits with complex physics and other background computation. There are plenty of amazing games developed this way, I'm

macro_rules! c_enum {
(
($count:expr) ? $enum_repr:ty ; $current:ident , $($rest:tt)*
) => {
pub const $current : $enum_repr = $count;
c_enum!( ($count + 1) ? $enum_repr ; $($rest)*);
};
(
($count:expr) ? $enum_repr:ty ; $current:ident $($rest:tt)*
) => {
@Lokathor
Lokathor / async-irc-bot-demo.rs
Last active April 25, 2018 03:23
A demo of an IRC bot that can asynchronously send and receive messages. No need for any fancy external crates or frameworks.
// This demo program is placed into the Public Domain.
use std::net::TcpStream;
use std::io::{Read, Write};
use std::string::String;
use std::thread;
use std::time::Duration;
/// We can expand on this later, but for now we just use an alias.
type IRCMessage = String;

General Rules and Houserules

  • Books: Core (4e or 4ea) + Arsenal + Augmentation + Street Magic
  • Matrix: Replace all previous Matrix rules with The Ends of The Matrix rules instead.
    • However, there are to be No Player Technomancers. The game is set very early in 2070, before the Emergence happens, so Technomancers are still just a spooky/weird rumor at this point. OOC: Player Technomancers will probably be allowed later on, but I just plain don't want to deal with that

Chaos Sundown Character Creation

Here's some character creation rules for an Origin Story After Sundown game.

The year is 199X, and seems like there might be monsters out there at night.

Attributes

  • All Basic Attributes start at 1, and then you assign 13 additional points. In

Prelude to Skeletons

"Now, listen carefully, for what I'm about to tell you really happened..."

Long ago, even before the era of Marduk, when wielders of dark magic could walk the earth as they pleased and prey upon all they found, there was a particular warlock in the far north of the world who ravaged the lands to carve out a space of his own. The warlock's true name has been lost to time, but his signature magic was a vile blast that melted away the flesh, leaving only the bones behind. Those killed by the skeleton lord's magic would instantly become