Seven Segment Thermometer
Hey look, a project!
While I’m waiting for everything to align perfectly for my descent into robotics (still waiting on Mars to align with Neptune, and a few misc pieces from Sparkfun, and soon I’ll be waiting for time), I’ve built a thermometer for the dining room. Three times. I’ve now gotten it to some form of a stopping point.
Pieces and Parts
This uses:
- 4x Common Anode 7 segment displays (got from Allied Electronics)
- 2x A6276- a 16 bit constant current (sink) LED driver (from somewhere)
- 2x 10k resistors
- 1x DC Boarduino (from Adafruit)- Arduino clone intended for breadboarding use
- 1x Prototyping PCB (from RadioShack)
- 1x TMP36 (also from Adafruit)
- More 22ga solid core hookup wire then I care to remember
The A6276 is pin compatable with the STP16C596, the apparent Arduino LED driver chip of choice. It was acquired in efforts to fix the legendary Proton LED sign- sadly (or fortunately) the chips on the sign were a different form factor, and the A6276’s were donated to my evil prototyping causes. The chips work as a constant current sink; when a pin is set high, it effectively opens a current limited channel to ground; when set low the pin is at high impedance.
The Boarduino was originally intended for use in a cable tester due to it’s awesome size (cable tester may be a different post… or just a set of images). Strange things happened with that, and it is now serving as an overpowered thermometer.
Displays of Seven Segments
Technically the displays are eight segments including the decimal. Which works out nicely for being driven from a 16 bit driver. This 4 digit display is the main reason that the thermometer is getting posted, and here’s why: I’m using a protoboard and 4 7-segment displays. There’s no direct/simple way to connect the LED driver’s to the pins of the displays. 32 pins need to be connected for the displays. 32 small wires. 64 solder joints. In a small space. I present: pain.
There’re probably also a great many samples of ‘bad soldering’ in that photo, but I’m ignoring that for now. Why? Because of this:
I’m 90% certain there is a much better way to do this (Possibly a 4 digit seven segment display?). But it works. And it is awesome.
The wiring for this part, other then being tedious and made of pain, isn’t complex. To prevent excess pain, I have the hookup wires always run parallel. What this functionally means is the pin out on the right side of an LED driver chip is reversed on the left side. This requires some special handling in the software, and is not necessarily ideal, but, we tossed out ideal with the 40 hookup wires. Ignoring the reversing bit, each display has it’s pins hooked up in the same order to a given 8 pin side of the driver chip. The rest is basic stuff- serial out on chip one to serial in on chip two; latch, and clock are shared between both chips, chip output (the R-EXT pin on the datasheets) is a 10k resistor to ground, etc.
I would actually like to do this again as an intro to PCB design project. When time is found to figure out how to use Eagle.
Sensing Temperature
Temperature sensing is mildly straightforward- the TMP36 sensor is supposed to put out a 0V-someV signal based on the temperature it is currently at, following a roughly specific formula (outputting 500mV at 0C, and increasing at 10mV per degree C). Just a simple analog read and conversion. Roughly.
You can see the TMP36 at the bottom of the pic, snuggled next to 0.1uF capacitor as the spec sheet requests. I tried this without the capacitor and tended to get strange readings quickly (within a few minutes). With the capacitor, they tend to be less frequent (that said, no matter how bad the insulation in my house, it was not 4F last night. I refuse to believe). I started taking a median of several readings in order to solve the issue of strange outliers, and it appears to have worked. No ghosts causing 4F readings yet.
One other quick comment though: The TMP36 outputs 10mv/C roughly. Due to the fact that the Arduino is using a 10bit ADC converter over a 5V range, it effectively reads in 5mv increments. Therefore, we can only read the temperature to an accuracy of about 1 degree F. Which is a bit sad, as it makes those last decimals of accuracy kind of meaningless. But alas.
Conclusion
I’ve built a thermometer! With (reusable) seven segment display! For more cash then I care to think about! I’ve had two other variations of this before: outputting current temperature to a set of normal LED’s in binary (fun, simple, slightly confuses relatives, need right LED size to make it nice), and to an LCD (can display high/low/current readings simultaneously, and be read by non techies). A few other variations could be done relatively easily: an indoor/outdoor meter, monitoring multiple rooms, temperature loss in ducts from straight out of AC to last outlet, etc.
This and a few other projects I’ve done fall under the ‘can be done with 3 output pins and maybe an analog read’ category of projects. I’m plotting to start playing around with the ATTiny series of uC’s to get the project down to component parts / decrease the requisite bulk. We’ll see how that goes. I’d also like to remake the 4 digit 7 segment display as a PCB prototype if I get the time/chance.
Depending on how things go, I suspect either the box game, tilt RC bot, or a report on the cable tester will be next. Or, alternatively, LC3D may get finished. Who knows with me?
More details are available on request, as I’m not sure what the best level of detail is for folk (non-existent ones at that).
UPDATE:
Small update. I changed the analog temperature sensor to a digital sensor, the DS18B20 (from Sparkfun), using a set of libraries for the sensor (from Miles Burton). The nicest thing about the new sensor is that it has an onboard 12bit ADC, which lets it sense temperature accurately to the last tenth of a degree that I was wanting. It also doesn’t appear to suffer from the same noisey readings I was getting with the TMP36. The only downside is that it takes 3/4’s of a second to get the 12 bit value and send it back to the Arduino. Which is fine for what I am doing, but it doesn’t seem ideal for other applications.
One interesting other bit about the new sensor: it can operate on only two lines; a ground line, and a data line. The data line is supposed to be connected (via a 4.7k resistor (why 4.7k?)) to a voltage source. When the sensor wants to send a 0 to the uC, it connects the data line to ground, and the uC reads 0. When it wants a 1, the data pin becomes high impedance, and the uC reads a 1 coming from the pull up resistor. Which I find fascinating- it’s about like staring into the abyss of infinite knowledge, seeing all these little connections, and then start to see the big picture form and make perfect sense. (It should be noted, I am not an author).
Arduino Project Ideas
Projects I’d like to eventually work on with the Arduino:
- PC Remote Control Robot- Preferably Built with K’Nex, but that’s inner child talking. A simple, lightly mobile, robot that can be computer controlled. Preferably with video cam for a robots-eye-view of the world.
- Tilt RC Robot- An interesting idea probably from a video I watched- using an accelerometer and a psuedo-game-pad to provide tilt based control of the robot. True, at this point it’s little more then an RC car, but it would have a cool controller!
- Mapping Robot- A bit more complex; a bot that can try and map out the space it is located in; no doubt in constant communication with a PC workstation
- Motion Control Lighting- We use a set of lights on a timer as walkway lights; I’d like to change that to motion activated from two locations, in some overly complex scheme
- PT Camera Mount- A Pan/Tilt mount for a camera; possibly to be combined with motion tracking.
- LED Table- More specifically, I’ve seen a coffee table esque item with LED panels underlaid. I’d like to do something similar as a sole source of light for a room. And/or implement Game of Life on it
- Simple Web Server- Web Server Controlled… thing. I’m thinking something for outputting, say, two connected temperature sensors in a web clean format; but it’d also be nice to figure out an application for a stationary motor
- Wireless Sensor Network- A set of sensors, connected wirelessly, each re/broadcasting sensor information at timed intervals. Each node would have the most recent reading of every other node stored, such that you only needed to interface with one node to get an idea of what everything is doing. Could also be an application of adhoc network routing; given a sensor network, find a route to and from the furthest node.
- Solar Powered/Recharged Wireless Sensor- Either as part of a motion sensing network for controlling outdoor lights, or finding the temperature of the outdoor air. Attach a set of solar panels to recharge a battery powered Sensor Node.
- Persistence of Vision Odometer- A set of LEDs connected to a bike wheel with a Hall Effect Sensor, set to display interesting characteristics of the journey as the wheel turns- current speed, trip distance, overall distance, etc.
- LED Clock + Weather- Build a binary LED clock which includes a color coding for current and forecast weather- Blue in the hours column for rain in 12h, Red in Minutes for Heat Stroke right now, etc. Would need a method of getting the weather forecast, but I’m sure that’s in some way solvable. Would also allow me to have a binary clock with a date listing, and automatic 24h based clock. (One of the items I dislike about a ThinkGeek binary clock purchased ohh so long ago- on power loss it loses the ‘24h’ display configuration). Possibly to be combined with wireless sensor network above.
- RC Car GPS Control- Hook a GPS device to the Arduino, and combine that with a high performance RC car to see what happens. Akin to having a UAV fly waypoints.
- AutoMower!!!- An automated lawnmower. Basically a push mower with drive motors mounted, hopefully able to map out the yard, and not fall apart due to vibration, or go into a lake
- Bike Trip Logger- For a different project, I would like to figure out how to log bits of data about changes in elevation on a bike trip. It’s theoretically possible that a set of accelerometers could help solve the core problem I’m working with. This eventually evolves into a system for suggesting bike routes; but I need to get data collection first
- Auto-Pilot with Video Transmission- I’d like to combine an RC plane with waypoint following and Wireless Video Transmission. Technically, what I really want from this is to be able to fly an RC plane with a first person view; so not actually an Arduino project. But a project!… for much later in life.
- 3D Rotation Puzzle- A bit simple, but could be interesting. Use either a 3 axis accelerometer, or a set of 3 tilt switches, to build a puzzle that you play by rotating. Generate sequences of increasing length using a random number generator. Use a painful buzzer of shame on failure, cool LED’s of awesome on successful navigation of the puzzle. Alternative would be to use time trials on a puzzle with visual feed back on next turn to take. (The description will make more sense when it’s implemented)
- Knock Lock- An interesting use of Piezo Elements is detection of sudden changes in noise level; as one might expect with, say, knocking. You could reasonably extend this to opening locked doors, for keyless house entry. Alternatively, might be safer to use a keypad, but why go the boring route?
- Plywood Impact Location Sensor- http://www.youtube.com/watch?v=WNZCS-coZjY FPS with real guns… or, you know, duck hunt. Whatever works for you. It also seems like, if this could detect soft enough motion, that you could then use said large surface as a simple input device.
- Kite Control- I’d like to get into Kite Photography. Or flying kites. Or both. One interesting aspect of this could be adding control surfaces to a kite, allowing for rudimentary wireless control… of a kite. (Side note: I am not an RC Plane Hobbyist, or Aeronautical Engineer)
- Air Soft Turret- Probably not technically Air Soft, but I’m not sure of the official name. Many moons ago, I and my brother got a set of small battery powered toy guns that fired reasonably painful yellow BB’s. I’d like to to strip the toy casing, and mount the parts onto a turret for remote controlled target practice… with co-workers. Would also probably go nicely with a robot mounting.
I think one of the more frustrating things about going from PC’s to microcontrollers is that while uC’s have the ‘interact with the physical world’ aspect to them, they have such limited processing power that for a lot of interesting applications they need constant contact with a PC. At least I suspect so. As an example, I’d like to play around with motion tracking cameras. Video Processing like that isn’t something that could be done on a 16 MHz processor. Granted, doing it real time would probably also be a strain on an average computer, but the point still stands. This is probably something better suited to embedded PC’s, which is another ball of wax I’ll need to play with sooner or later.
Broad Update
Yes, this shall be a blog updated once every few months to say ‘I should write more’. Whatever.
ACM and AI
Starting with the current purpose of this blog, the ACM Local competition was last week; and I successfully succeeded at succeeding. First place by one problem. I went to the last two ACM contests with one of my teammates, and the other one I have a fair amount of confidence in. We shall see what happens. But, as a humorous aside to that: I very nearly implemented a Sudoku solver in under 30 minutes. Had I stopped asking myself ‘is it worth it to put in this much effort into a problem you probably won’t solve before the contest is over’; I probably could have solved it. Probably not, but maybe. I solved it using a horribly hacked together Constraint Satisfaction based Solver. For that interesting 30-50 minutes of my life, I would like to thank Robin Murphy (AI Prof), and Peter Norvig (Algorithms God/AI Book Author); both of which suggested Sudoku solving as an application of CSP. I’ll probably clean it up later and post it… as it stands currently it makes me want to cry, but it theoretically should work. (Theoretically because the test data was, in fact, invalid).
Education- Dr. Tao?
On a different note, I think I’m going to go for a PhD. This conclusion was got to by an interesting failure in my ability to communicate. As part of a follow up email, I had written the line ‘assume I go for a PhD’, which led to the thought ‘If I graduate and go into industry with a Bach, I’m going to end up drifting from job to job with mounds of uncertainty and stress’ (drifting coming from the popular consensus that a programmer should expect to change jobs every 2-3 years). If I get a PhD, there’s a lot less uncertainty in terms of job (at least I hope), I have the opportunity to interact with really incredibly frustratingly annoyingly intelligent folk, and if I go the academia route, I can torture a class of Yankee’s with ‘Howdy Class’. How can you not like that?
As a side note, I suspect the reason I was never comfortable with the thought of Grad School before is because I had never really come across something that peaked my interests. There’s a popular quote by Dijkstra: “Computer Science is no more about Computers then Astronomy is about Telescopes”. I have this odd sense that it is often misinterpreted from it’s original context. Computer Science is about the mathematical basis behind computing: proving algorithms correct, classifying problems as NP-hard, finding the most efficient way to find a correct solution, all about the theory. To me, that is what Computer Science Grad School is/was about. And I hate that definition. Mostly because it feels like something from the Ivory Tower- occasionally interesting results with only limited real world applicability. I want to generate solutions to real problems. Is making a formally proven OS kernel useful? Maybe to some, but spending 5 years to develop 10,000 lines of proven code just feels like a waste. I’ll probably regret those statements later, but, such is life.
Further side note: one thing I’ve heard fairly commonly is that in general, you don’t recoup the cost of a PhD. A master’s is worth it, but a PhD won’t earn you more over a lifetime. My response: Who cares? If you’re making a career or education choice based soley on ‘will it pay off in the end’, then you’re doing something wrong. Education (and career) should be driven off personal interest, and as an auxiliary, will it earn enough money such that you won’t live in a cardboard box. Going into advanced education because it will buy your retirement home a heated pool is just plain wrong.
Shiny New Toy- Arduino
Yet another different tact, I have a shiny new toy. An Arduino. With a product name which I can neither remember, pronounce, nor spell. I can at least remember/spell Arduino… pronunciation is still off. I blame the Italians. I got it in part because I wanted to get involved in the electronics/embedded side of computing, and mostly because it provided a convenient way to solve a problem my brother was having.
My brother, through what I assume were family connections, was hired to fix an outdoor LED sign for a bank. The company that manufactured the sign had gone out of business, but he was able to get some schematics for how the individual boards in the sign were wired. While he could take the boards down, ohm out connections, and so on, he didn’t have a convenient way of actually testing that either the repaired sign worked, or finding where issues might lie in malfunctioning boards.
I psuedo-come-in at this point. He asks me if I can write a program that would be able to test the boards. The boards themselves are driven off 4 inputs- 2 serial lines, a clock, and a latch. In the sign they’re driven off of what is probably a parallel port on a 386 running windows 98. I’m not sure if you’ve noticed, future reader, but most computers these days don’t come with parallel ports. So I go through the thought process of ‘how could I go about this’; serial ports don’t really work, as at most you might be able to control voltage on two lines; we could go through the trouble of finding and installing a parallel port expansion on a testing computer, and try to write a program that would drive the port/board. And then I thought “wasn’t there something Kyle mentioned not long ago; an Arduino?”.
It fits the bill perfectly. So the short ending to this is: the first day I got it, I broke it out, did the standard “Make an LED flash” thing to see if everything was working; and the second day I built a controller for the sign boards. A bit later I added some simple configuration bits, a button to switch between testing modes, and hooked up the 9V battery so the computer became completely unnecessary. My brother has since stolen it for testing, until he can get his own.
So, I feel good about that. One thing I’ll probably post soon is a list of projects to go along with it. Y’Know, to go along with the other list of projects I’m not making progress on. I might also post more details about the sign, as it was a fun first project/jaunt into Computer Engineering.
Deutschland
I’m also planning to go to Bonn next Summer as part of a study abroad program. I’m trying to learn some German for that; and it’s coming along slowly. And that’s it. That’s all. See y’all later.
Developer Training
Let’s chat about an idea I had for a training project; something to bring someone from an academic environment into a mildly professional environment. When I first started at the ESL, I was given a relatively simple project… after I was given a fair amount of grunt work you’d expect of a high school intern. I spent more time then I should have on that project, but in retrospect I realize that, if adapted slightly, it’s perfect for bringing someone up to speed on things like databases, ORM, .NET, how the web actually works, etc.
Background
Part of what our lab used to do is maintain a database of hourly weather readings at sites across the state. In the past we received emails from the Meteorology department with a fixed width file that contained the relevant data; and we would parse these emails with a cron job on an ancient UNIX machine; the data going into an Informix database. For one reason or another this system needed to be shutdown (Meteorology stopped sending emails; UNIX machine got hacked and destroyed; desire to make the data more accessible; etc).
The original goal of this project was to replace the old system with a more accessible system; in our case using Microsoft technologies (SQL Server for data storage; and a .NET language for data retrieval). The new goal is to do this while iterating through technologies that you’ll encounter in your everyday life.
Data
I figure this is worth spelling out first. Previously we received data in the form of an email. Where precisely are we going to get weather data now? We can’t just go around installing internet enabled weather stations… this is only a training project, not a mass system deployment (sadly).
As it happens, NOAA provides the (current) weather readings in a freely available XML format. As an example: http://www.weather.gov/xml/current_obs/KCLL.xml is for Easterwood Airport, College Station, TX. They provide these for many locales, listed here: http://www.weather.gov/xml/current_obs/seek.php?state=tx&Find;=Find. Most of the XML files will update only once an hour, but there are a few that’ll update more often.
Goal
The goal is to, given a list of weather stations (either URL’s or just station names), write a service that periodically pulls down the weather data for each station, parses it, and puts it into some form of long term data storage. Duplicate readings (ie the weather station hasn’t updated) shouldn’t be stored. Also, the XML files contain a fair bit of extraneous data that can be done without; we can ignore anything extra.
Advised Process
- Start by getting source control setup.
- If getting an svn server is too much overhead, look into using Bazaar, git, Mercurial, just some form of source control.
- Setup a project / solution structure. In our lab we would have a root project folder containing overhead files (solution file, build files, etc), and then a Source folder and a Database folder under the root.
- Throughout this I’ll mention that ‘everything should be in source control’ at the end of an iteration. This is not to imply that that is the one specific point to check in all your changes to date. Source control should be an integrated part of development: once you hit a milestone, it’s time to do a commit. Remember, ’commit early, commit often’. Just don’t commit broken things.
- For a first iteration, download a single file, parse it, and display it to the screen
- Interjecting a bit of personal thought; when you first attempt this, try it using a Raw Socket, and the HTTP protocol. Not because it’s advisable (it’s not), but because it shows you the foundation on which the web is built. It’s good to understand this most basic building block.
- Once you’ve had fun with raw sockets, look into what your language provides by default for making web requests. C# provides a WebRequest object with a Create method that can be used; Java, python, etc probably provide something similar.
- For Parsing. DO NOT USE ANY METHODS ON THE STRING CLASS. Parsing XML by hand is something that you will be shot for: it’s a death penalty offense. Look into what your language provides for XML Parsing.
- For storage; for this first iteration, just store to a flat file; one entry per line.
And that’s it for the first iteration. Make sure everything is in source control, and have a senior fellow review what you’ve done. At this point the senior is looking for basic faults: did you name a public property ‘theTemperatureRightNow’ or ‘Temp’; as well as basic class structure.
- The next element is to add configuration, multiple stations, and the ’service’ aspect to it.
- .NET configuration is usually done through a file called app.config (later renamed to AppName.<extension>.config), and is accessible through System.Configuration.ConfigurationManager ; I’m not sufficiently familiar with other languages to say what’s available; but writing a Config Manager isn’t terribly difficult if your language doesn’t provide it.
- When I say service; I don’t necessarily mean a Windows Service (or unix dameon process); just a program that contains something akin to for(a very long time). At the simplest level, this can be done with a while(true) loop, with a 15 minute thread sleep. Your language may also provide a Timer construct specifically for firing off threads at specific intervals; using that would be perfectly valid too.
NOTE: this isn’t something that would be repeated once every second, or once every minute. The data updates at best once every fifteen minutes; common ettiquete demands that ~fifteen minutes be your shortest pause. - Logging would also be good to play around with at this point. Most logging packages also come with a form of file configuration; look into playing with that a bit.
At this point we have a configurable service that will pull down data from any number of weather stations, and parse out the bits we want. Put everything in source control, get a senior to do a quick review of what you’ve done, and listen to any comments they have.
- Next, we’re going to add database storage.
- Determine an appropriate database schema. I would suggest two tables, one carrying weather station information, the other carrying reading information. A reading should have a link back to its weather station; and each table a primary key.
- For this version, use the raw API’s provided by your platform/language; learn the joys of SqlConnection, SqlDataReader, and parametrized queries.
So, again, everything in source control; have a senior look at it. At this point, database design and class structure are probably most important; the data storage layer should have a well defined, simple interface that doesn’t cause a headache on viewing.
Also at this point, you should have a starting idea for what SQL is like. The project should be far enough along that it can collect data. Let it run for a day, and play around with getting interesting weather stats in SQL.
- An ORM layer
- If the data access component was coded to both save and load Weather Readings, then it’s probably possible to extrapolate the fact that writing this transform code sucks. A lot. If left with only SQL, a developer can spend a few days working out data access for a mildly complex object; potentially weeks with things more complex.
ORM fixes this by implementing a wrapper layer for the whole of SQL Transformation; your only job in turn is to define what’s relevant to the transformation.
- Implement another Data Storage class using an ORM technology. Use the same interface as the SQL storage class above.
That’s it for this one. Call a senior over to see what you’ve done; they should be checking to see that everything makes sense, looking for possible points of confusion, etc.
- If the data access component was coded to both save and load Weather Readings, then it’s probably possible to extrapolate the fact that writing this transform code sucks. A lot. If left with only SQL, a developer can spend a few days working out data access for a mildly complex object; potentially weeks with things more complex.
And that’s it for now. It could be extended to include things like Dependency Injection for choosing the output method; a web application fed off the database to get summary data, which can in turn evolve into an AJAX web app with web service back end. You could also go the route of a desktop summary viewer if that’s relevant to what you do. You can attempt more random and off the wall ideas- try to build a temperature map off the data and an overlay of the state map; AI algorithms for predicting the next hours readings; statistical analysis (linear regression to predict temperature at a station that didn’t report); feeding the data into a weather simulation in an MMO. All manner of things.
There’s also a bit of unit testing / TDD possibility, though I’m not certain it’s quite complicated enough to warrant it, and a TDD intro is probably better done by pairing at first, which goes against the goal of a (mostly) solo training project.
Conclusion
I have presented a poorly worded and untested training project. This project is suitable for use as a first project by interns and student developers. This project’s primary goal is to bring less experienced developers up to speed on shop practices, while also providing a reasonably interesting and non-daunting problem for the new developer to solve.
The primary problem with this approach is that it isn’t immediately relevant to what’s being done in your group. Once finished, you’ll still have to go through and bring the dev up to speed on your project. Hopefully the active training will take slightly less time as you don’t have to go through and explain the major concepts. And hopefully they’ll be less likely to commit major sins, but it’s still not ideal. The ideal would probably be to bring the dev up to speed through pair programming, and slowly let them start working on their own / take control.
All that said; it might be just me that’s interested in this stuff. I like being able to go back and say ‘yes, the high for last week was 103 F; with a max wind speed of 20 mph’. I can foresee some developers being less enthusiastic about developing this system. However, for those actually interested, I think this would be a good learning experiment.
Light Cycles 3D- Progress Update 1
Okay, I’ve started work on a first iteration of LC3D; and I’m working on the domain portion now; plotting to do graphics last. My current plan is to implement the game in single player form to get it working, and play arround with some cools things that can be done with the graphics/interface. Specifically, I’d like to try implementing a real time glow effect (http://http.developer.nvidia.com/GPUGems/gpugems_ch21.html for reference); and something slightly more interesting for the folk that die early: maybe a simple fly through the course option, or a circling outside camera; either would work, and a ‘fly through camera’ would allow me to play arround with multiple degrees of freedom movement, something I would need to do for some of my other games.
So, to recap, I’m implementing it in single player form for now so that I can play around with getting bits of it right. When I finally finish that, I’m going to figure out the best structure for sharing state between multiple clients, and eventually fix almost everything. And it will be glorious.
On a related note; I had a thought on networking and death: what to do in the case of a player that dies (or doesn’t die) because of network latency in getting a change direction command across has been a major issue for me. Right now, my line of thinking is this: if a Player sees himself crash into a wall, then the player failed, and his client should send out the ‘I am dead’ signal. If a change direction on the part of the person he crashed into would have saved him; it doesn’t quite matter: he died living a full 20 second life. If a change direction does result in his death when he didn’t see it happen… well, thats unfortunate; but kill him anyway; and have his client report the death. (the ideal would actually be to slightly ignore it, but because of the game state implementation, that would be much more difficult then it sounds). Sadly, this is more vulnerable to cheating (player reports his own death, and only his own death), and may also be more vulnerable to the ‘what did I hit’ question; but I think the case will be rare enough that it won’t be a problem.
Hopefully.
Further completely unrelated sidenote: I now have an avatar… A gnome playing with the GTK symbol, originally put together in 1998 by someone at TAMU (http://www.isc.tamu.edu/~lewing/gallery/gnome/). I have stolen and slightly altered it, though am hopefully attributing it with this post.
Light Cycles 3D- Concept
Until a better non copyright infringing name comes along, we’re going to call this ‘Light Cycles 3D’, or LC3D.
History
As I said in the list of projects post, this has in fact been implemented once before: it was an (unsuccessful) entry into a TAGD one week game competition. Humerous fact: I went through and built it, got it finished, and everything partially working except for the jitter with network game play under C# (.NET 2.0) with Managed DirectX. Go to show it off at the one week get together, to find that the library computers are using .NET 1.1; and probably don’t have the specific Managed DirectX library needed for it. Sadly, didn’t get it converted in time for the presentation, so now one of the goals of the project is to write it using standard C++ and OpenGL.
Concept
The basic concept behind this game is to take the classic Tron/Light Cycle game on a 2D discrete grid surface, and allow movement in a confined 3D discrete grid space. Discrete grid means the space can be broken into individual squares/cubes: it is not a continuous space (as Armaegtron uses). This has a very different game play feel in that it goes from a fast-paced strategic ‘block off the enemy into a tiny box’ game play, to a slower ‘avoid death as long as possible’ style. A slightly less arcade feel, though I prefer the visuals while playing through it: sort of like flying through the Windows Pipes screen saver. Fun and enjoyable? Probably not. But interesting and visually appealing for me.
Game Play
The game takes place in a closed cube, by default a 10×10x10 shell. A player is able to see the cube through the ‘eye’ of his… ship; as opposed to the overhead view used in traditional Tron games. 6 Players start each on one side of the cube, facing the opposite side. Time then begins and each player moves at one square per time increment. The players leave an impenetrible trail behind them, and they are able to either: change direction (up, down, left, right) once per time increment, or simply go forward. If they smack into another players trail, they die, and are out of the game; their trail staying present. Last player alive wins.
An obvious multiplayer element exists: the 5 other players could be network players, AI, or (an odd and humerous side effect from testing), a clone of the single human player. Obstacles or uniquely shaped arena’s (nearly flat rectangle, donut, barbell) could be added to make game play slightly more interesting. It’s also been pointed out that this wouldn’t be too far removed from a ‘worms in 3space’ type game.
Implementation Thoughts
Because implementation is never far from my mind.
The problem with network game play in the first iteration of the game was ‘jitter’: in original game play, the game world had discrete (and visually jarring) steps: you would advance 1 unit of space every quarter or half second; to offset this eye bleeding problem, a smooth transition was added from one discrete step of the universe to the next. Whenever an update was received from the server, this was treated as ‘reseting time’; so, if the update came 100msec later then expected, the transition would move you backwards by 100msec*speed; and similar would happen on the next update (might have been 100msec early this time, etc). It was entertaining to watch, but also quite sad. This could have been fixed by varying the speed of the cycle based on updates (time dilation, woohoo), or a few other odd methods. I suspect fixing this satisfactorly is going to be a bit of a painful process, but we’ll see when we get there.
Changing subjects, one of the first things I did when I decided to do this for a one week game was figure out how facing worked with respect to changing direction of the ship: The ships facing is defined with a forward vector, and up vector, and I went through a very ungreat set of if statements to figure out the changes to these two vectors based on commands made. For example, selecting up means setting the up vector to the negative forward vector, and forward vector to the up vector. Working out the changes for turning left and right wasn’t exactly clean. I’d like to figure out how to translate that into simple matrix math; though until I have the time to work that out, I can probably just copy over the original code for it.
List of Side Projects
- Tron3D – Sometimes also called ‘light cycles game’. Basically the classic 2D light cycles game with an added dimension. Players move arround in 3-space, theoretically trying to end their enemies. In practice it’s more of a ’survive until they die’ kind of game, where all players start at opposite sides of a 10×10x10 cube. I’ve written this once with a networking component, as part of a one week game project for TAGD; but, the network play didn’t turn out well. I’d like to rewrite it, fix the networking flaw, and maybe add strange things to game play… like caverns/walls/a user interface.
- Tachyon RTS – Tachyon: The Fringe was a fun and enjoyable game from my better-forgot youth. In it, the player piloted a ship for one of various factions, theoretically for their sides ideals. It was akin to an arcade flight combat sim, with a fairly ‘deep’ story. I have that in quotes because I’m not sure if it was actually good, or if it was just a young mind captivated by the story, forming odd building blocks for a permanent fascination. But, irregaurdless of the psychological aspects, I’ve been curious for a long time to see it in RTS form: building up a mining base, or launching strikes from carriers, directing whole scale war efforts. It needs much more refinement, but I think it would make for an interesting project. That, and it would give me a chance to finally build a space based RTS (this side-desire is due to Conquest: Frontier Wars… another relatively awesome game from the days of old)
- Fix family websites. I ‘maintain’ two websites for family members (dad and brother). Both are abominations to good layout and design. Mostly because I’m not a layout person / web designer / graphically oriented fellow.
- Dungeon Builder / Viewer – Originating from D&D, and the dwarven forge tilesets used one or two times in my group. The first version of this would just be something for building multi-level dungeons, and viewing them in that high level of detail that comes from the dwarven forge tileset. In theory this would evolve into a more complex DM client, but I haven’t put that much thought into it yet.
- Tower of Simulation – Or better known as SimTower. I have no idea why, but I want to rewrite it.
- City of Simulation – Similar to Tower of Simulation; though for this one I think it’s more because I want to play around with the details of a complex simulation.
- Copter of Simulation – Just because the list seems incomplete without it. That, and the arcade-physics driven copter flight model meant I was actually capable of playing the game.
- Brothers Frac Pump Interface – Interfacing with a Frac Pump over a CAN-BUS. My brother is in the business of oilfield technology something or other. He’s built data cables, data vans, and is plotting to get into rewiring/servicing frac pumps. At least that’s how I understand it. He had the idea of developing a wireless tablet for the data vans for remote control of frac pumps. I’m not sure if it’ll ever see the light of day, but I’d like to do this for the whole ‘controlling something in the real world’ feel.
- Strange Flight Sim Thing – (The official name). What I actually want is to have the visual look and feel of EVE like combat (which is to say, space combat), with an indoor environment. Massive battles and dog fights and such within the 4 story open air portion of the Zachary building. Evading your pursuers by flying into an alcove and then through an open door. And so on. This is clearly doomed to fail as I have no 3d modelling ability, which comes to the next bit.
- Capture a 3d model from video of an environment. I have a sense this would be more of a thesis project; or, alternatively, that it’s already been done. I’m quite certain that it is technically ‘possible’ if the environment is static, and if the video does not contain impossible shapes/environments (looking at you, Picard); I just don’t know if its acheivable…
- Tao… thing – Envision for a second, a gnome. Of magely death and destruction. Now envision the gnome in a battle. Against Orcs. That make humans look small. Not so much a programming problem as a 3D animation and effects problem; but, if I were to ever develop artistic talent, and/or join the Viz Lab, this would be one of my projects.
- Taluva – A board game requiring either very little or very much skill. You’re building an island and several settlements; land consists of triangular hexagon groups (3 hexs), where 1 hex is a volcano, and two hexes are habitable land. There’s more to it then that, but the description suffices for now. It’s a straight forward game, made slightly more interesting by the fact that over the course of the game you are building a 3d model of an island.
- PowerGrid – Another board game. You play the part of a power company, connecting cities together, and buying power plants for powering said cities. Features an auction component and a whole lot of simple addition. I suspect, if I were to force my mind to it, this would make an alright project for an AI class; but it’s a bit more complex then I’d like… we’ll see.
- Linear Army Command – Not the best of descriptions; based on a game played on; I think it was a Mac, more then 10 years ago, in black and white if I recall correctly. or 16 colors, such are 10 year old memmories. Takes place on a 2d field of combat, you pilot a helicopter, and have the ability to pick up and parachute off troops, and buy tanks, APC’s, and rocket artillery, with which to take over command points, and eventually your horrible enemy’s base. I don’t remember all the specifics to it, but it was rather enjoyable, and would actually seem like a decent flash game, if it hasn’t already been made several thousand times; and if I ever learn flash. (I know I’ve seen similar versions, though you’re generally only an indirect factor, where as in this game you have the ability to personally demolish things).
UPDATE: Thanks to Jae, we now have name for the original game: Armor Alley, published in 1990… ish. - Deity vs Deity RTS- I blame this one on someone in TAGD; I think either Danny Dyer (Dier? Dyier? bah), or Jacob Beaudoin… or both. And possibly someone else. While comming back from an Austin Game Developer Conference/Meeting/thing, somehow the concept of a game where in you fight as (we’ll go with an angel) against demons, devils, and other bad and terribly things came up. I suspect they saw it as more an FPS or RPG, but I think it’d be interesting to take it to an RTS form. And I’m fairly certain this predated the odd South Park episode with a similar game concept. Almost certain.
- Online todo list/task system – When I remember to, I use tadalist for remembering things to do… like homework. The problem with tadalist, is it doesn’t provide an easy method of tracking when something needs to be done by. Or relative priority. I’d like to build yet another task list (called DragonTasks, but thats beside the point), to correct this horrible and grevious oversight on their part of providing the simplest todo list system possible. May also have something to do with a lack of desire to try other task systems.
- What I Remember. I go through a lot of life remembering random bits of the past. Some of these memories I’d like to continue remembering. Some I’d like to just have down so I can more clearly reflect on them. I’d like to setup a web app suitable for sitting down at and transcribing and inter-linking/inter-relating these thousands of events. In theory, and a bit more morbid, this could also be passed on to surviving family members; sort of a legacy of ‘these are the parts of my life that I remembered 15 years down the road’.
- Just a grab bag of whats left: RayCaster/RayTracer (probably do that in a computer graphics class though), RubyBat – the Ruby version of JavaBat, Moon/Mars/Space Tycoon- because the list isn’t unoriginal, or space based, enough yet; some form of FPS;
some form of MMO (I’d actually like to figure out how to do an MMORTS, but I have no idea how that could work); and a MUD. - NeHe tutorials- More of a side project, not even worthy of the grab bag; I’d like to go through all the NeHe tutorials to get my bearings in OpenGL again.
So, as we can see, I seem to have a fetish for 3D, Space, and RTS’s. And a large lack of originality.
When I first wrote this list (on paper), there were about 20 items. I’ve forgotten things. Very sad. When I remember I’ll probably just edit this post; so, be warned: this will change.




