Skip to content

Instantly share code, notes, and snippets.

View milesrout's full-sized avatar

Miles Rout milesrout

View GitHub Profile
@louisswarren
louisswarren / builtins.py
Last active September 21, 2016 10:08
Co-sane implementations of python builtins and more
import itertools
sum = lambda x: list(itertools.accumulate(x)).pop()
len = lambda x: sum(1 for _ in x)
range = lambda n, step=1: itertools.accumulate(itertools.repeat(step, times=n-1), lambda x, y: x + y)
# Full implementation
range = lambda min, max=None, step=1: itertools.accumulate(itertools.chain((min if max is not None else 0,),
itertools.repeat(step, (max-min-1)//step if max is not None else None)))
@louisswarren
louisswarren / ideas.md
Last active June 9, 2016 04:21
Good ideas that people should do
  • Use a set-based filesystem (instead of directory based). These would act like tags. Sets generated from predicates would also be handled by the filesystem (when used), for example ?modified>yesterday, ?size<1M. These could also include file extensions.

    vlc media,?modified>yesterday

    for files in the set 'media' which were modified since yesterday, and

    vim &gt;&gt;modified

import functools
def accumulate(accum_type):
def outer_wrapper(f):
@functools.wraps(f)
def inner_wrapper(*args, **kwds):
return accum_type(iter(f(*args, **kwds)))
return inner_wrapper
return outer_wrapper
@croxis
croxis / gist:6436553c3542ec692c1d
Created March 24, 2015 00:08
Rendering procedural planets.
Based on feedback from ChemicalR I'm cross posting all the things I've bookmarked in reguards to planet rendering here in the code forums.
[url=http://www.gamasutra.com/view/feature/3098/a_realtime_procedural_universe_.php]Sean O'Neil[/url]'s 4 2001 part series is considered a foundation for realistic large scale (planets on up) rendering. Most of these methods are now obsolete and replaced with faster methods and gpu shaders. His [url=http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter16.html]atmospheric scattering[/url]method is still used often due to its relative simplicity, but it only produces earth atmospheres.
[url=http://acko.net/blog/making-worlds-1-of-spheres-and-cubes/]Steven Wittens[/url] 2009 multipart series is frequently linked to as I've searched for best practices in creating planets using modern methods. It is based on a cube with mesh texture and normalizes the vertex points into a sphere. The advantage to this method is that conventional terrain LOD methods, often used in first
@croxis
croxis / gist:f08d1ce071072b8efbc0
Created March 24, 2015 00:04
Trillek Single Solar System Arguments
In irc there was talk about FTL and the assorted gameplay issues with each method. Then I started thinking about other design and story issues trillek is having. Then I started thinking about my space game I haven't touched in a while.
A few years ago I saw a video similar to this one http://vimeo.com/40234826 and I was really struck by saturn's moons. Saturn has over 70 moons. That is a lot of surface area to explore and with assorted orbits around each moon, and saturn itself, that is a lot of gamespace. I also saw this picture http://misc.oranse.net/misc/wallpaper/earth.jpg taken from low Earth orbit and how amazing our planet looked from low orbit. I started designing a game with the setting of just our solar system that takes place during humanity's expansion into our solar system.
What if we used that setting, or a similar one, instead? What if trillek takes place in one solar system?
Using our solar system as a model: There are 4 terrestial planets. 4 gas giants. At least 4 dwarf planets and a numbe