Jump to content

Ed Minchau

  • Content Count

  • Joined

  • Last visited

  • Days Won


Ed Minchau last won the day on June 8

Ed Minchau had the most liked content!

Community Reputation

118 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So, the map of the asteroid is based on an icosahedron, the 20 sided Platonic solid: This has been tessellated once; a new vertex created at the midpoint of every edge, with the new vertices extruded out to an equal radius and connected to all their nearest neighbors. This gives a solid with 80 triangular surfaces: There are still only 20 equilateral triangles on this object; the other 60 triangles are isosceles but close to equilateral. Inside each of these triangles we can draw a circle that touches all three sides. Doing so leaves gaps at the vertices upon which we can center some more circles: I did that markup in Paint so it's not perfect but you get the idea. There are 42 vertices and 80 faces, so 122 circles can cover about 78% of the surface. the other 22% is the little gaps between the circles. The orange circles are on equilateral triangles, the red circles are on isosceles triangles, the blue circles are on vertices with 6 edges and the green circles are on vertices with 5 edges. When a circle is in the center of the screen, the image looks exactly the same (with rotations) as it would if you were looking at any other circle of that color. So, as long as each circle has a list of where everything else is relative to itself and some base rotation, the asteroid image centered on any circle can be generated using one of only 4 generic maps. Each triangle is divided into 81 smaller triangles or "cells". There are 18 of those 81 triangles that are outside the circles, which will always remain terrain. For the orange, red, and blue circles that leaves 42 cells, and for the 12 green circles there's 35 cells. This next image shows the 42-cell version in two rotations and the 35 cell version in four rotations: (I used this image to help generate the closeup orthogonal view, by squashing it to a 192:13 aspect ratio, putting gray grid lines on the result, then putting numbers in a spreadsheet according to colors inside grid lines. The spreadsheet took over from there.) The buildings that are going into this game have to fit into 42 cells and still look recognizable without the last 7 cells in the pentagonal map. Here's how I'm indexing these cells for buildings: There are 128 bytes set aside for each building type. The first 42 bytes describe the cells' height from 0 to 7 (bits 4,5, and 6; bit 7 is 0) and a color index from 0 to 15 (bits 0-3). The next 22 bytes aren't allocated yet. The 65th byte is a building type byte. That color nybble in the first 42 bytes does not refer directly to a color on the palette. Instead, it points to a list of 15 day colors and 15 night colors (color index 0 is considered a terrain color, and for that, color is indexed separately by height). So the 15 bytes following the building type byte are the daytime colors, and refer to the palette index. These are followed by a building level byte, and then the 15 night colors. The next 20 bytes aren't allocated yet. The last 12 bytes are used for the building name. For every cell on the map there's a sunset value (0 to 255), and the asteroid has a rotation value (also 0-255), so if sunset minus asteroid rotation is positive the daytime color is shown otherwise the night color is shown. At startup the program goes through each cell on the map and finds the palette index of the day color and night color for each cell and stores those in lookup tables in banked RAM, so the drawing subroutine only needs to switch bank numbers to find sunset, day color, or night color. Why am I showing all of this? I think I'm going to need some help designing buildings. For visualization purposes, each cell is a triangular tower, and each step increase in height is roughly 1/4 of the length of an edge. A max height 7 tower would be almost twice as tall as it is wide. Height 0 is fine; it just means the cell height is the default height of the building area but colored differently than the terrain. The 15 day colors and 15 night colors can be any of the 4096 available colors. Each cell can use only one of those pairs of colors; if it's using #13 for day then it's also using #13 for night. As a fun complication, I'm not going to have just one palette. There will probably be 16 of them, cycling in once every 1/3 of a second. Most of the colors will stay the same from palette to palette, but I'm going to set aside 32 or 64 of them to change from palette to palette. This could lead to some interesting and computationally cheap animation effects. For instance, suppose 4 palette entries are a daytime color, say an amber color most of the time. And another 4 palette entries are a night colors, say a darker brownish color. Suppose that color 1 (both day and night) is gray instead in palettes 0-3, and then amber/brown in palettes 4-F; and that color 2 is amber/brown in palettes 0-3 and 8-F but gray in palettes 4-7; color 3 is gray in palettes 8-B, and color 4 is gray in palettes C-F. Then using those four pairs of cycling colors on cells that are close together could make the illusion of something gray being moved across an amber/brown surface. Or more simply, imagine that a color is gray in most of the palettes but red in palettes 7 and F. Then it would be a blinking red light every couple of seconds. That sort of quick animation would take place simultaneously all over the image, and in the closeup image, all just by loading 512 bytes into VERA every 20 VSYNCH interrupts. It'll make it look like there's a lot more going on than there actually is. So, if anyone wants to take a crack at designing a building, just come up with 42 bytes to describe the height & color index, and a listing of the RGB values for each of the 15 day/night colors, and if any of them are color cycling list the RGB values for that color index for each of 16 palettes. That and 12 Petscii characters for the name. If anyone submits a building I'll probably use it for something in the game. I'm working on a Headquarters building first, as that will always be the first building placed on the map. After that buildings will have to be placed next to existing buildings. The other buildings I have in mind are: - power plant - habitat (probably several examples of this: level 1, level 2 etc) - greenhouse (ditto) - mines of various types - smelter - refinery - foundry - 3D printer (enormous) - storage tanks (various) - warehouses - factory (various types) - maintenance shop - hospital - armory - wretched hive of scum and villainy, with live band - shipyard - launchpad I might write a tool to make it easier to design buildings. If I do, I'll probably share it here.
  2. More progress: closeup 3d orthogonal view and scrolling text.
  3. Yes, the sprite data should already be in VRAM. The sprite attribute table at 1FC00 will point to the start location of the sprite data in VRAM. I found @SlithyMatt's sprite tutorial on YouTube very helpful.
  4. The 1541 disk drive had its own 6502 IIRC.
  5. For Asteroid Commander, I'm doing something similar to what @ZeroByte did. The compass is a sprite, but it is one of 10 sprite images and may be flipped vertically or horizontally to give me the range of 30 images needed. It was simplest just to make a lookup table in RAM with 30 entries of 8 bytes each, and just copy the 8 bytes I needed into VRAM. The sprite images themselves are loaded elsewhere in VRAM. My subroutine to push the 8 bytes from the sprite attribute table in RAM, SPRA, into sprite #2 in VERA looks like this: (Y contains a rotation index from 00 to 13 for pentagonal areas or 14 to 1F for hexagonal areas) LDAY CORI; compass orientation table TAX; X is SPRA table low byte LDA# 02; compass is sprite #2 LDY# >SPRA; high byte of sprite attribute table STX0 60 STY0 61; 60/61 start address of 8 bytes to send to VERA STA0 62 STZ0 63 ASL0 62 ASL0 62; NB max 128 sprites ROL0 63 ASL0 62 ROL0 63 LDA# FC CLC ADC0 63 TAY; VERA address mid LDX0 62; VERA address low LDA# 11; step size 1 and VERA address high bit is 1 JSR VCH0; shown below LDY# 00 LDA (60),Y STA 9F23 INY CPY# 08 BNE# F6 RTS VCH0: PHA LDA# 00 BRAN 03 VCH1: PHA LDA# 01 STA 9F25 STX 9F20 STY 9F21 PLA STA 9F22 RTS
  6. Using FETVEC is probably the way to go. Like @ZeroByte, I have kept my development at R38 until an official release of R39 comes out. I prefer to use only the official release version, even though a preliminary release is available.
  7. As long as we're wishing, how about being able to define functions that take more than one parameter?
  8. Part of the reason Apple was so big in schools was the recognition by Apple that students were future customers. Apple donated a LOT of computers for that reason. We're not going to get that kind of market saturation because our purposes are different.
  9. You can just let the math do that for you. Any value in the range 0-255 is 8 or less away from a multiple of 17. Or, avoid the problem by setting the Red value to 0 across your palette and just use the remaining 256 combinations of green and blue.
  10. Yep. Sort of. I can set custom colors for the background of cells, set a Style to that color, and then use that Style by reference, i.e.: J30=T(STYLE("C4"&J14)) Whatever value is in J14 (a hex digit from 0 to F) becomes the color displayed in J30 (so if J14 contains 3, the style displayed will be style C43). This is actually much better than graph paper, because I can make all sorts of changes, no problem. I even have the spreadsheet set up to generate a BASIC program, so once I make all my changes I just copy one sheet to the clipboard and paste it into the Commander X16 emulator. edited to add: the world's most popular Functional Programming language isn't Haskell, it's Excel.
  11. I'm using Libre Office spreadsheets and Paint. Not ideal, but it gets the job done.
  12. This is the main program (for now), initialization, and the custom IRQ handler. This is all being written in the META/L editor, so it's easy for me to make changes and test quickly. The only other tool I've used so far has been Libre Office spreadsheets and a ton of notebooks. .
  • Create New...

Important Information

Please review our Terms of Use