The UVMC2 starter kit ships a set of small programs next to the SDK. Each one is a complete game image that builds with make uvm2. Each one is also the worked example for one part of the libraries. If you want to know how a module is meant to be used, start by reading the matching example.
| Example | Shows | Libraries |
|---|---|---|
hello_uvmc2 | The smallest real game: frame loop, a ship with thrust, text, a raw controller readout | libvpy |
physics_demo | Crates and balls in a pit: dents, shattering, blasts, sparks, shot marks, impact sounds, a hinged door, convex hulls | vpyphys, vpyfx, vpyimpact, vpy3d |
soft_demo | A flag in the wind, a jelly blob, a jelly cube | vpysoft, vpy3d |
bone_demo | A 13-bone figure walking and running, feet placed on steps by IK | vpybone, vpyik, vpy3d |
scene_demo | A whole scene built from entities under an orbiting camera, with 3D text and stereo impacts | vpyent and everything under it |
fx_demo | Shapes that come apart where they are shot, then assemble again edge by edge | vpyfx, vpy3d |
occlusion_demo | Three turning meshes hiding each other, with the occluder switchable | vpy3d |
geometry_card | A test card to photograph | v_directDraw32 |
game/tacscan | A full arcade port: Sega's Tac/Scan, emulated | AAE, the SDK's sound and SD |
hello_uvmc2: start here
This is the template for a new game. Copy the folder, then change UVM2_NAME and UVM2_SRCS in the Makefile. That's all a new project needs. See Your first game.
src/main.c(about 175 lines) holds the whole game: the frame loop, the ship, thrust, text, and an on-screen readout of the raw controller values.- The
Makefile(about 55 lines) is the smallest build that produces a.um2. tools/text_metrics.canswers "how wide is this string?". libvpy's font advances by a different amount per glyph, so a string's width has to be measured, not computed. The tool links the realvpy.cand prints the width plus the left edge for a centred line.
Controls:
- Button 1 thrusts along the nose.
- Buttons 2 and 3 rotate.
- The stick also rotates, but only once it has been seen near centre. A stick stuck at one end is ignored rather than spinning the ship for ever.
physics_demo
Crates and balls fall under gravity into a pit. You drop them and shoot them:
- A hard knock or a shot dents a crate.
- The third shot shatters it, and its blast scatters the others.
- Every hard contact throws sparks, and a shot leaves a mark on whatever it hits.
- Every hit makes a sound, synthesised from how hard it was.
There is also a door on a hinge, and convex hulls: button 3 drops a crate, a pyramid and a wedge in turn.
This is the demo to read for vpyphys and vpyimpact, and for vpy3d's mesh occlusion, dents and marks (vpy3d). It also prints its stack peak (STACK), as described under Debugging.
soft_demo
- A flag on a pole, flying in a wind that the stick sets.
- A jelly blob that keeps its area: button 1 drops it, button 2 punches it.
- A jelly cube: button 3.
Uses vpysoft and vpy3d.
bone_demo
A 13-bone figure walks and runs. The stick blends two clips that share one phase. The figure goes up and down steps with its feet placed by two-bone IK, and plays a wave clip on one arm. Uses vpybone and vpyik.
scene_demo
The whole scene is built only from vpyent entities (crates, balls, walls) under an orbiting camera. One call draws the scene near to far through the occluder, and one call steps it.
It also shows:
- a turning two-faced 3D sign, words painted on the floor, and billboard labels over the newest bodies;
- shots that dent and mark through the entity;
- impacts heard from the camera's position, in stereo on the UVMC2's jack.
fx_demo
A turning shape comes apart from where it is shot: a wave travels out from the hit while the far side is still whole. Then the next shape assembles edge by edge from flying pieces and is handed over to the real mesh when the last piece lands. The shapes are a cube, an octahedron and a pyramid.
Uses vpyfx and vpy3d_ray_mesh. tools/host_render.c renders a scripted session to SVG on the desktop.
occlusion_demo
Three meshes turn, and one swings through the others. Button 1 switches the occluder off so you can compare. It's the smallest example of drawing near to far through the occluder (vpy3d).
geometry_card
A test card drawn in device units straight to v_directDraw32. Photograph it to answer two questions about a console: is one unit the same size in x and in y, and where does the visible glass end? Its results are behind vpy3d's default aspect and window, and behind the ASPECT / WIN fields of the calibration screen.
game/tacscan
A complete arcade port. A Sega G80 machine (a Z80 plus Sega's vector generator) runs through AAE's driver, with the romset read from the SD card. Its sampled sound plays either on the console's sound chip or on the UVMC2's 16-bit jack, and it comes with a desktop test harness. It is the worked example for Porting an AAE game.