Skip to main content

Posts

Showing posts with the label sprites

New Worlds Part 2

There are still some thing to add to the terrain set, but its mostly finished for now. It's really great to have a fully featured level editor so that the map elements can be tested right away. No messing around with modifying text files or external programs. Just switch modes and paint. The terrain has achieved the appearance I aimed for, which is similar to a table top gaming board. I never wanted a photo real game environment, and I'm happy with the way it has turned out. It reminds me of bonsai trees or miniature gardens. It is quite obviously tile based, there's no getting around that, but it's important in any case, since otherwise it could be difficult to know where units can move or not as well as guessing lines of sight. Most of the techniques I've used here are things I tried before, but I never got them looking so nice or running so well. Drain on the graphics card is negligible at this point. The shader works really well. The movement shader ...

More Artillery!

I got the artillery converted over to act like a hybrid unit. I really like how they turned out, though it did expose some messiness in my code. After cleaning up some junk I feel like the project is pretty well organized so far. Here's an animation of the light artillery: And the heavy artillery: With artillery you can set your crews to defensive stance to protect them from enemy fire, but it makes their rate of fire and movement rate slower. I'm considering allowing artillery to be sandbagged (fortified) and camouflage nets to be deployed when in sentry mode, as a special skill for high level units.

Stress Test and Artillery

I did a stress test with infantry yesterday: The important bits to look at are "Logic" which is the performance of my python scripts and "Rasterizer" which is how long the scene takes to render. At this point with around 375 infantry men in the scene Rasterizer is proving a much bigger drain on resources than Logic. In fact Logic costs are really very low indeed. They'd have to double again before you'd get a loss of frame rate from 60fps. That's great news! Some other things I worked on this week: Adding the code for units to use binoculars. This allows you to see further but with a limited field of view. Good for scouts or officers. Began working on artillery units. For now they work almost exactly like vehicles, the infantry modes are just static meshes. I hope to make them a kind of hybrid unit with mesh guns and sprite crews. But for now they work like this. The have to be deployed before use, and stowed for transport. This ...

Vinland UI

Starting work now on the UI for the game. I need to get on with this as it's going to handle controls for things like changing infantry formations, giving orders to your units, targeting and combat etc... Here's an early version of the UI command buttons: The commands will also be accessible by hotkey. For example the first 4 are A, S, D, F: 1. Attack, 2. Sentry, 3. Defend and 4. Flank. These will set the overall state of the selected units. Attack will make the unit move to the selected destination or enemy, trying to shoot whenever possible. Sentry will go in to observation mode and for infantry they will go prone. Tanks will open their hatches to get a better look around. They won't attack unless first attacked, and will get a better visual range in this mode. You can use the ambush mode as well (second row, number 6), in which case they won't get the visual bonus, but will be harder to spot. Defenders will try to turn automatically to face the nearest...

32 vs 64

I started to worry yesterday that the size of the textures involved with adding a lot of infantry types would start to put a drain on lower end graphics cards, so I had a think about how to deal with that. One thing I did right away was to rationalize the number of animations. A lot of the ones I chose were not really that essential, so by being a bit ruthless I was able to cut it down to 8. By halving the number of animations I was then able to fit two infantry man animations on a single sheet. I further tested using 32x32 pixel sprites instead of the current 64x64 pixel sprites: It's difficult to see the difference at the normal level of zoom. You have to zoom in quite a lot of notice: Now you can see the big difference. I think the 64 tiles are much nicer than the 32 tiles. I don't think it would be worth cutting them down that much in quality. But since I will be loading the sprites from an external file, I'll think about including a set of low rez sprit...

Rifles

Added a second infantry type in to the game for testing. Now there are riflemen and sub-machine-gunners. I found a way to reduce the time it takes to do the animations, which is nice. It was really pretty quick to animate this one.

stormtroopers

As I said in a comment my last post, by duplicating some frames and mirroring them I can get 7 directions out of just 4, so the final result should be similar to what I was showing in earlier videos. Today I worked on some new infantry models: These are some Holy Roman Empire troops. The HRE is a large sprawling pan European Franco-German empire, similar to but much more successful than the Holy Roman Empire in our timeline. Right now they look a bit too like Germans, with the grey uniforms. I'm probably going to make them more brown or blue-green. Here's a preview of the animated sprite doing all 16 animations: It didn't take that long to do all the animations, though some will have to be modified for other infantry types (like riflemen or machine gunners etc..) The important thing is that all animations are available, so I can get to work adding them in to the game for testing and see how it goes from there.

4 frames

After testing the infantry extensively I've come to the conclusion that it's possible to depict an infantry man with just 4 directions of movement and 4 frames of animation. Previously I was using 8 directions and 8 frames of animation. That's; 4x4=16 vs 8x8=64 Obviously 8 frames looks much better, but not so much that it's worth 4 times as much resources. An 8x8, 64x64 pixel animation takes up 512x512 pixels. That means for a 1024x1024 sprite sheet I could fit in 4 animations.  Each infantry type has 16 animations at the moment: default : Just standing around waiting. walk : walking, running, marching, it's all pretty much the same. fidget : A general all purpose action, for laying mines, serving an anti-tank gun, etc... ride vehicle : Crouching atop a tank or assault gun for quick transport.* shoot 1 : a variation on shooting their weapon. Maybe standing. shoot 2 : so it doesn't look boring, an additional shooting action, crouching f...