3 more problems down...one was in Ruby, which was easy/fun enough, one in Whenever, which is a ridiculous language except for when it is easy to write a solution in one line, and one is in Ook, a variant of Brainfuck. Despite how fun it has been to write brainfuck code, if I actually want to reach my goal, I am going to have to stick with more "reasonable" languages for a bit
Problem 4: Ruby
Find the largest palindrome which is the product of 2 3-digit numbers
https://dl.dropboxusercontent.com/u/34972177/PELC/e4.rb
Problem 5: Whenever
Find the smallest natural number divisible by the integers 1,...,20
https://dl.dropboxusercontent.com/u/34972177/PELC/e5.we
Problem 6: Ook! (Compiled to Ook! from Brainfuck)
Find the difference between (1 + 2 + ... + 100)^2 and (1^2 + 2^2 + ... + 100^2)
https://dl.dropboxusercontent.com/u/34972177/PELC/e6.bf
https://dl.dropboxusercontent.com/u/34972177/PELC/e6.ook
Thursday, August 8, 2013
[MMc] GUI Built
Here's the plan, updated with the implemented portion in green. Current rendering of the game:
![]() |
| Resizable, Skinned Windows and GUI Controls over a dynamic Starfield |
- Build GUI infrastructure for popup ship windows (equivalent to the main view in a traditional RTS)
- Window render
- Window draw
- Window resize
- Window close
- Zoom control
- Ship View inside the popup windows
- Draw ships (with zoom and pan)
- Show modules as plain hexagons
- Left mouse selects, drags, and activates module
- Right-mouse pans view inside of a window
- Icon modules
- Draw main view that shows a "realistic" universe (equivalent to a minimap in a traditional RTS)
- Integrate starfield prototype
- Overlay GUI
- Show ships
- Show free modules
- Draw paths
- Main view interaction
- Support zooming
- Show ships
- Support selection of ships
- Provide waypoint GUI
- Warp-drive
- Module interaction
- Drag within ship
- Drag outside ship
- Drag inside ship
- Activate
- Target modules in other ships
- Simulation
- Compute dynamic commodities, e.g., heat, power, etc.
- Simulate attacks
- Trading (needs more GUI)
- Polish graphics
- Per-user color
- GUI stylization: bloom, noise, ripple on hit
- Re-coloring of ships
So after some work i have a functioning rasterizer that will render a simple scene like Cornell Box pretty fast. I was originally running into a but where i did not properly convert the points to camera space before projecting them onto the camera plane. This caused a weird error which looked like this.
After i fixed the issue it looks like this. The change in brightness is not from my render but from a change in the scene.
The shading might look pretty bad right now but that is because i am not focusing on it. What I want to do now is optimize the hell out of the rasterizer and then at the end I will deal with trying to make the shading look nice. right now it is just a simple lambertian.
After i fixed the issue it looks like this. The change in brightness is not from my render but from a change in the scene.
The shading might look pretty bad right now but that is because i am not focusing on it. What I want to do now is optimize the hell out of the rasterizer and then at the end I will deal with trying to make the shading look nice. right now it is just a simple lambertian.
[Sam] 3 Solutions
Problem 1: BrainFuck
Find the sum of all multiples of 3 or 5 less than 1000: (Answer printed in unary)
The code I actually wrote:
https://dl.dropboxusercontent.com/u/34972177/PELC/e1.bf
The more cool-looking version:
https://dl.dropboxusercontent.com/u/34972177/PELC/e1Unreadable.bf
Problem 2: Haskell
Find the sum of all even Fibonacci numbers less than 4000000
https://dl.dropboxusercontent.com/u/34972177/PELC/e2.hs
Problem 3: J
Find the largest prime factor of 600851475143 (First line is my initial solution, the second a better one James helped me find)
https://dl.dropboxusercontent.com/u/34972177/PELC/e3.jis
Find the sum of all multiples of 3 or 5 less than 1000: (Answer printed in unary)
The code I actually wrote:
https://dl.dropboxusercontent.com/u/34972177/PELC/e1.bf
The more cool-looking version:
https://dl.dropboxusercontent.com/u/34972177/PELC/e1Unreadable.bf
Problem 2: Haskell
Find the sum of all even Fibonacci numbers less than 4000000
https://dl.dropboxusercontent.com/u/34972177/PELC/e2.hs
Problem 3: J
Find the largest prime factor of 600851475143 (First line is my initial solution, the second a better one James helped me find)
https://dl.dropboxusercontent.com/u/34972177/PELC/e3.jis
[Sam] One down...
Because of the difficulty of using it, I decided that problem number 1 should be written in BrainF. It took most of the morning, but I have succeeded at this task. I unfortunately needed to compromise my rule of "programs must output the solution, not an intermediary value needed to compute it", but because the intermediary value was extremely easy to parse into a solution (I output a number of characters equal to the solution), but it would have been incredibly difficult to actually print a number, I decided to stick with the intermediary version. My next problem will be done using a much more sane language...maybe something like Haskell, which I have never used, though it is a language that is actually meant to be used.
edit: I did not compromise my rules, the number is printed in unary.
edit: I did not compromise my rules, the number is printed in unary.
Tuesday, August 6, 2013
[Michael] Radiosity
I want a short project that won't feature creep on me as much as my games always do, given our reduced time and my lack of prep time.
I'm going to use OptiX and G3D to write one or more radiosity solvers; hopefully getting results in real time.
Victory condition: Having a standalone G3D program that can basically render
in a minute.
Bonus condition 0: Reduce render time to 1-2 seconds
Bonus condition 1: Reduce render time to 67 ms
Bonus condition 2: Support dynamic objects.
I'm going to use OptiX and G3D to write one or more radiosity solvers; hopefully getting results in real time.
Victory condition: Having a standalone G3D program that can basically render
in a minute.
Bonus condition 0: Reduce render time to 1-2 seconds
Bonus condition 1: Reduce render time to 67 ms
Bonus condition 2: Support dynamic objects.
[Dan] Rasterizer
My plan for this hackathon is to write a software rasterizer that will hopefully by the end of the forty eight hours be able to render some cool scenes in real time.
Monday, August 5, 2013
[Sam] Project Euler Language Challenge
I don't have any good ideas for games/etc. floating around in my head right now (though the Dominion AI idea proposed over lunch today sounds interesting...that may or may not happen at some later date). So, I am deciding to pick up a proposal that came up over an earlier lunch during the year that sounded like it would be fun - try to solve as many Project Euler problems as possible (in 48 hours), but each solution must be written in a different language. My goal for now is to do at least 20, though I can hope for more.
Goals:
In order to make specific what I will be doing, I have established a set of rules to formalize my task:
Rules:
Goals:
- Have fun revisiting Project Euler problems / potentially solving new ones for me
- Learn the basics of some "real" programming languages that I have never gotten a chance to use (like Haskell, Perl, Ruby...)
- Muck around with silly / ridiculous programming languages while having an actual goal in mind for their use instead of playing with them just to play with them.
In order to make specific what I will be doing, I have established a set of rules to formalize my task:
Rules:
- Each "solution" must both follow the Project Euler rule of taking about a minute or less to run to completion, and in addition must actually be capable of outputting the solution in some manner - a program that gives information that can then be used to deduce the solution through additional work or guess and check over a small range is not sufficient.
- Two languages, in order to be considered "different," must not be related by age or have a subset relation in code. For example, Java 1.5, Java 1.6, and Java 1.7 will all be considered "Java," even though each is a slightly different language. Also, C/C++ will be considered the same language as any Project Euler C++ code will probably use very few, if any features that are not in the C subset. In addition, for the purpose of this challenge, "assembly" and "machine code" will be considered one language - I am not going to just go around and write assembly for a bunch of different architectures.
- A "language" is defined loosely as basically anything you can write in in order to instruct a computer to perform a sequence of instructions - languages need not be Turing complete or live up to any other such qualifications. Meta-languages such as the C Preprocessor and the C++ template meta-language will be considered unique languages, though preference will generally be given to "real" languages before working with them.
- I will say that non-programming solutions are invalid - among these would be pencil and paper, calculator usage, graph plotting, excel spreadsheets, etc - due to the increased difficulty in establishing an adequate metric for difference among such methods, and due to not being in the spirit of this challenge. However, this rule may change at a later date, as trying to solve problems in this way could be pretty fun.
- Programs must be either hand-written or programatically written by programs I wrote - a solution is not in "Java Bytecode" because I used the Java compiler, but a solution could be in Whitespace if I wrote a Python script that allowed me to convert semi-human-readable text into Whitespace.
- A new Project Euler account will be made for this project in order to record my progress
- Outside Project-Euler specific help is not allowed, including but not limited to looking at the forums for a problem and looking at my own older solutions (most of which are written in Scheme/Racket, Python, or Java)
- I will post my solutions to the Project Euler forums for each problem as I complete them
Sunday, August 4, 2013
[MMc] Starlight
For the hackathon I'm revisiting a game that I wrote in a month two years ago but never released because the original version became too large to maintain.
Title: Starlight
Platform: Windows
Players: 1 (maybe)
Concept: An RTS where your "empire" is a spaceship that you can fly. Add new rooms, upgrade the hull, trade and battle with other ships.
Related Games: Galaxy Trucker, Minecraft, FTL, The Ur Quan Masters, Age of Empires, tower defense and RTS games
Technology Plan:
Art Plan:
Title: Starlight
Platform: Windows
Players: 1 (maybe)
Concept: An RTS where your "empire" is a spaceship that you can fly. Add new rooms, upgrade the hull, trade and battle with other ships.
Related Games: Galaxy Trucker, Minecraft, FTL, The Ur Quan Masters, Age of Empires, tower defense and RTS games
Technology Plan:
- Use G3D, 3DS Max, Photoshop, SVN, Audacity, CFXR
- Spaceships are made from hex tiles, with math from my codeheart.js example
- Minimize state and assets, e.g.,
- Procedural generation of the galaxy and visual elements
- Dervive all ship data directly from an single image of the ship
- Rely heavily on emergence
Art Plan:
- Procedural starfield for tactical and navigation view
- Ships are sprites pre-rendered in 3DS Max from TurboSquid models
- UI is drawn in monochrome and then noised and bloomed, using tech developed on A Thousand Moonlit Seas
Design Plan:
- Straight RTS mechanics, except components are found and bought instead of built directly to avoid players having to learn a tech tree and recipies
- No "units"
- Emphasis should be on building and configuring the ship, with flying, combat, trading, etc. forming increasingly tighter reward cycles.
- AI is (as always) a risk. Multiplayer?
Early Asset Tests:
![]() |
| Procedural Starfield |
![]() |
| Spaceship Rendered in 3DS Max |
![]() |
| Spaceship Hexified on Load |
Screenshots of Old Prototypes:
![]() |
| Fully 3D Prototype Emphasizing Flying |
![]() |
| Another 3D Prototype |
![]() |
| 2.5D Minecraft-like Prototype with Intricate Wiring Mechanics |
![]() |
| 2.5D Prototype with UI |
Combat in the 2.5D Prototype
Thursday, August 1, 2013
Machinis Ludo 4: Algorithm Jam
The Williams graphics group will run a two-day graphics hackathon to celebrate the end of summer research internships. Others are welcome to join us, but based on the short notice we're not going to do a full game jam and explicitly invite people.
Proposal Deadline: Monday 2013-08-05. Projects can be solo or group, and need not be a game. This is a great chance to design a new G3D feature, implement a graphics algorithm that you've always been curious about, or just play with a demo effect (e.g., maybe in shadertoy). If you want to make a game, that's of course welcome--I'm currently planning to make a game myself.
Start: 2013-08-08 9:00am ET (early starts and exploration are fine)
End: 2013-08-09 3:00pm ET...for real this time, so that we can have a cool-down party.
Sleeping and showering at some point in during the hackathon period is highly encouraged. We'll have a mix of takeout and meals out in the lab--sometimes taking a walk for coffee, or half hour at the pizza place is better for workflow than plowing through and eating at your desk.
As usual, post your proposal to the blog before the deadline and then post regularly during the hackathon to document our progress.
Proposal Deadline: Monday 2013-08-05. Projects can be solo or group, and need not be a game. This is a great chance to design a new G3D feature, implement a graphics algorithm that you've always been curious about, or just play with a demo effect (e.g., maybe in shadertoy). If you want to make a game, that's of course welcome--I'm currently planning to make a game myself.
Start: 2013-08-08 9:00am ET (early starts and exploration are fine)
End: 2013-08-09 3:00pm ET...for real this time, so that we can have a cool-down party.
![]() |
| Desert Morning shadertoy sample |
As usual, post your proposal to the blog before the deadline and then post regularly during the hackathon to document our progress.
Wednesday, July 3, 2013
[MMc] Victory
I'm declaring victory in the game jam, but fully intend to spend every free moment between now and Thursday midnight working on Castles & Catacombs. There's an entire game that captures the Monaco and Minecraft feel, plays with joysticks in a browser, and has a consistent retro pixel style of all original art.
It also has only about 1% of the features that we want to add, though. Tomorrow's a holiday and I'll finally have (half) of a day off to work on it properly! Coding from 11pm to midnight every day wasn't really cutting it for making progress.
It also has only about 1% of the features that we want to add, though. Tomorrow's a holiday and I'll finally have (half) of a day off to work on it properly! Coding from 11pm to midnight every day wasn't really cutting it for making progress.
Congratulations to everyone! Our next jam will be in late August or September. I hope that Mike and I can both take off two days then to really host everyone properly in the lab. I was shocked to find the lab empty at 6am this morning! :)
[Nigel] Finished! Stairaway.
I'm quite happy with this game. Not because it is particularly
interesting, but because I managed to create exactly what I wanted.
Play Stairaway here!
I came into this wanting to make a game about stairs. I also wanted to make the game in pure JS, and with online functionality. I somehow hit all of these goals.
There are two modes: (Controlled by the arrow keys)
- Survival : Press the correct arrow keys to climb the tower. Avoid the lava for as long as possible.
- Online VS: A head on head race. First person to die to lava loses.
Additionally, the game has networking enabled, allowing for the following:
- Server stored high scores.
- Working online matchmaking for the Versus mode.
Messing with node.js/socket.io to get networking working was quite the experience, and I feel I learned quite a bit through making this game.
Anyway, fun times. Can't wait to try everyone else's games.
[Michael] The end of the beginning.
I've fixed up the text bugs and finished up my level editor(!), which allows for straightforward creation of levels from pre-made parts, each consisting of a full physics description (using Box2D) and an arbitrary number of images. I've added in duplication and deletion in the last few minutes (I'm at the point where every few minutes makes the level editor or game significantly better. It's where I really like to be in a project). Note that since I was at home alone for the home stretch, I've put off the multiplayer aspects until after the jam.
I whipped up a non-trivial level and added an invisible goal that causes victory if you reach it.
Despite the things that cropped up getting in the way (I spent a large part of this afternoon helping out the repairman in getting my washer and dryer fixed, for example); I've technically "won" the jam. Far more importantly, I'm at the stage where everything I'm coding is fun; and the game improves constantly.
I intentionally bit off way more than I could chew for this jam: working in a completely new language, with a completely different debug cycle than I'm used to (gotta love those hours chasing down a trivial bug a typechecker would have found), integrating a full physics engine and creating a robust level editor. I used this jam as a concentrated period of time to get a large project I can be happy to work on off the ground.
I'm excited to work more on this game and I'll package up what I have so far and post it here later this week.
I whipped up a non-trivial level and added an invisible goal that causes victory if you reach it.
Despite the things that cropped up getting in the way (I spent a large part of this afternoon helping out the repairman in getting my washer and dryer fixed, for example); I've technically "won" the jam. Far more importantly, I'm at the stage where everything I'm coding is fun; and the game improves constantly.
I intentionally bit off way more than I could chew for this jam: working in a completely new language, with a completely different debug cycle than I'm used to (gotta love those hours chasing down a trivial bug a typechecker would have found), integrating a full physics engine and creating a robust level editor. I used this jam as a concentrated period of time to get a large project I can be happy to work on off the ground.
I'm excited to work more on this game and I'll package up what I have so far and post it here later this week.
[CO'D] Down the Rabbit Hole...
So... Morgan... I'm really sorry. I hacked the CRAP out of Codeheart.js. It's so bad the file is called codeheart_lite. I couldn't even think of it as a shadow of what it was. But, it works with Ejecta. However, it will probably never be the same again. On the up side I could totally get rejected from the App Store again now:
Like a dog with a bone, I couldn't give up the idea that I ought to be able to combine the two. I think there must be some sort of perverse pleasure that one takes in taking well structured and thoughtful code and doing unspeakable things with it.
Like a dog with a bone, I couldn't give up the idea that I ought to be able to combine the two. I think there must be some sort of perverse pleasure that one takes in taking well structured and thoughtful code and doing unspeakable things with it.
[Sam] "Victory" on-time
So, I entered with the goal of making a tower defense where all the state, both enemies and towers is nothing but dice...and I succeeded! Right now I think the game makes the jump from trivially easy to nearly impossibly hard a bit too quickly...but that can be ironed out later if I want to, and ironing it out would require some playtesting. However, the game now works with (I believe) no bugs or issues, is mildly fun, and has a beatable 'easy mode' (the only difference between easy mode and hard mode is that easy mode lets you know that you won when you reach level 25, whereas hard mode will just go until you lose...which, unless I am just really bad at my game or my recent changes fixed things substantially, will be soon after level 25. But anyway, the game is in a finished state, though I may add additional features, and the most recent version can be played here: https://dl.dropboxusercontent.com/u/34972177/dice/play.html.
And, the proof that the game is beatable:
And, the proof that the game is beatable:
Overall, this was a very successful jam - using codeheart certainly helped, as did having a solid enough idea for the game that most of my time was spent coding and not contemplating what should be coded.
final stretch
So i now have a working game. below is a video of me playing it. It may be confusing because there are two green squares. The top one is the player and the bottom one is an obstacle that i have been using to test my physics engine. The weird camera motion was also not part of the game. I did that to try and show the drops falling and hitting the block.
As you can see it still looks pretty bad and the playing interface is pretty boring and there are no instructions but it has a winning condition so that is good.
I have been working on trying to add obstacles and getting my physics engine to work well with them. so far it is not the best but it has been getting better.
The real issue with this is that i wanted the whole thing to be solved by doing physics calculations. so if my collision is erratic and completely unpredictable then that sort of goes down the drain. I think i might be able to get it to the point where it might be predictable enough to include. even if it doesn't follow real physics.
Pretty soon i will have to transfer from working on the physics stuff to actual focusing on the game play. So i will have to design levels, make the interface better, and make the whole thing more appealing to look at.
Tuesday, July 2, 2013
[Michael] Hectic Day
Several things popped up that kept me from jamming as much as I'd like (I'm reclaiming some of those hours tomorrow...); but I've made some major (if almost entirely invisible) progress. And not just relearning the hard and long way how to debug in a language with no static type enforcement and no compile-time errors...
I have a complete working level format: each level consists of 4 things: a name, a starting position, a goal position, and an array of level objects. Each level object consists of a physics body, consisting of as many Box2D collision shapes as needed, and an array of sprites, which are the visual components of the object. Each sprite can be static, or dynamic. If dynamic, it has a working animation system using sprite sheets.
I have a method for serializing and deserializing levels to and from JSON. Far from trivial, since Box2D makes heavy use of prototypes, which aren't preserved by a round trip through JSON.stringify and JSON.parse.
I've hooked in Morgan's file saving and loading code, so my program loads levels from disk and the level editor can save out.
I spent quite a lot of time hacking up the physics so that platforming feels smooth; still much to do to get it to feel alright.
I'm punting on art for the jam; I'm much more interested in finishing up my sophisticated level editor and tweaking the engine so that the controls feel right.
And finally, so this post isn't just text: my ugly as sin main menu (text rendering seems to be bugged, so I've put 0 effort it making it presentable), when you try to quit!
I have a complete working level format: each level consists of 4 things: a name, a starting position, a goal position, and an array of level objects. Each level object consists of a physics body, consisting of as many Box2D collision shapes as needed, and an array of sprites, which are the visual components of the object. Each sprite can be static, or dynamic. If dynamic, it has a working animation system using sprite sheets.
I have a method for serializing and deserializing levels to and from JSON. Far from trivial, since Box2D makes heavy use of prototypes, which aren't preserved by a round trip through JSON.stringify and JSON.parse.
I've hooked in Morgan's file saving and loading code, so my program loads levels from disk and the level editor can save out.
I spent quite a lot of time hacking up the physics so that platforming feels smooth; still much to do to get it to feel alright.
I'm punting on art for the jam; I'm much more interested in finishing up my sophisticated level editor and tweaking the engine so that the controls feel right.
And finally, so this post isn't just text: my ugly as sin main menu (text rendering seems to be bugged, so I've put 0 effort it making it presentable), when you try to quit!
[MMc] Adventure Graph
Castles & Catacombs contains a world of individual adventures, each of which contains one or more scenes. The picture above is the world map, in which adventures are circles on the road. The reward cycles for Castles & Catacombs are:
- Character movement
- Reaching items in a scene
- Completing an adventure goal:
- Clear gold coins
- Clear silver coins
- Recruit new character
- Beat the par time
- Unlocking a new adventure
- Completing all goals for all adventures
I've been working on the data structure that tracks progress through the game and the code for the world map that shows what adventures are available. The world stores a table mapping adventure tags to descriptions. An adventure description contains:
- Position on the world map
- Criteria to unlock this adventure (e.g., clear all gold on four other adventures, unlock the druid)
- Tag of the opening scene of the adventure
The map rendering code compares the description of an adventure to the progression state for the local save game and then shows appropriate symbols for progression through the adventure, whether it is locked, and whether it is new (flashing green circle).
I only had 45 minutes today to work on the game, so I'm falling far behind. I foresee my team spending much of the 4th of July completing our game after the deadline. I mean "completing" in the "making fully playable" sense, not "reaching a state where we'll never work on it again."
Next steps:
- Follow pointers between scenes after loading all scenes to give proper coin counts when inside the adventure
- Reset the state of adventures on exiting them (the entire world is currently persistent, which can make some adventures unbeatable if left in a bad state)
- Redraw the gold coins
- Draw silver coins
There's 16 hours left in the jam. I hope that everyone else is at least taking a short break for sleep. Good luck tomorrow, everyone!
[CO'D] End of Day 2...
I mentioned it in a comment on my earlier post, but I'm done with Ejecta for the time being. :( Just a bit too complicated to connect with Codeheart for the moment. However, I modified my Pong-like game to play more nicely on mobile devices. Here is a touchier version called Pong-like-touch:
I started on my Berzerk-like clone today. The first thing I discovered is that I'm fairly certain I can't just color my sprites with an overall canvas fill color, which I was hoping for. This is sad, because I was really hoping for some interesting variety in the colors with that approach...
Player controls are in. Enemies are in. Now I just need to decide how to handle level data and collision. Then I'll transition to getting enemies to fire back at the player and move toward the player. Finally will be keeping score. After that I'll go back and finish up the sprite-sheets and animation of characters... Not likely for tomorrow, but I can hope.
Subscribe to:
Posts (Atom)






















