Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, August 25, 2014

Random Update

Between moving country, searching for a new job and trying to get up to speed in said job, I haven't really had much to say on the blog. But I recently finished assembling a model I've been working on for a very long time, and I decided it justified a post. Here's a couple of teaser photos:
After an unholy amount of effort the design finally came out looking pretty good.
The money shot! This was actually taken earlier, before I had fixed the pattern.
The model is one of my very favourite 40K models, I bought it at least three years ago and started working on the conversion about two years ago, but gave up when I couldn't find a good way to make the bases the way I wanted. However, when I finally managed to fit a battery in a normal(ish) looking base, I started looking at him again. Then I got busy with Warmachine models, then with moving and job hunting, then with Warmachine models again. And when I finally did start working on it again, I spent ages on little details that I wanted exactly right. I decided that it was finished and then realized I had forgotten something or wanted to change something about three times before I finally ran out of things to do. And (with the exception of the subject of the photos), all of the things I was doing were really very minor and subtle and most people probably would never notice if I don't point them out. But if I didn't do them, I would know. And I would never be happy with it.

Other than that, I finished assembling my Nyss grunts (Cylena still has a bit of work), and did some work on another model I'm trying to get to light up. Unfortunately I won't be able to paint any of them any time soon as it seems the only way to get spray primer in this country is to ship it in via surface post, which takes like two months. I did do a bunch of painting on another big project I've been meaning to finish for over two years though, I was very happy with that, though there's some more work to do yet.

I haven't been able to play very much Warmachine, but I gave my friends a few demo games. The Decimator is pretty good in battle box games; much more fun than the Destroyer anyway. We played on a plain table without any terrain and only a few painted models, but I'm planning on getting my hands on some nicer terrain, hopefully that will make it more enjoyable for people.


I've also started looking at my game engine again. OK, this needs a bit of background I think. At my last job, I was spending a good number of hours a day staring at a computer monitor coding, then coming back home and spending more hours staring at a computer monitor coding. Progress had slowed and I was getting tired, so eventually I decided to try to spend my limited free time on hobbies that didn't involve staring at a computer screen. Well, not quite as much any way.

Now let me back up a bit. Several years ago, I bought a laptop. Not my first, but the first one that I bought for myself. It was pretty much a middle spec deal, but it was nice and small (for the time). I really liked it, and still do. But a few years later I needed something more powerful for some work. So I ended up buying the most powerful laptop I could locally get off-the-shelf. It was a rather large laptop that I never really liked very much, but it did everything I needed it to at the time. I kept it for work and the older laptop for personal use. Until the older laptop started overheating and shutting down, so I retired it and moved to the larger one exclusively.

Recently I decided to try to see if I could get some use out of the older one, so I had the insides cleaned up - which seemed to solve the overheating problem - and installed...

No, hold on, let me back up again. Microsoft sucks. I've tried not to hate them, but lately they've really, really been getting on my nerves. I'm not going to go into it right now, but I'm done. No more Microsoft products for me. I've just been given a mac at my new job, and while I can see that it has a lot of great things going for it, there's annoying differences in the basic interface that make it a little uncomfortable for me.

... and installed Ubuntu on it. After a couple of false starts, I got it working properly. And it's very nice. It has the simplicity that Windows is missing and the comfort and familiarity that I'm not getting from my Mac. So yeah, I'm thinking it's on it's way to becoming my favourite OS. I'm hoping to convert my other laptop eventually, but I can't be bothered right now.

So I've been enjoying getting to use my old laptop again; I find it's keyboard and scrollpad very comfortable, the battery life has improved under Ubuntu, and unlike my larger laptop it doesn't burn me when I try to actually use it on my lap (yeah, that one might need the dust cleaned out as well).

What was I talking about? Oh yes, my game engine. Well, after resigning from my last job, I decided to try to do some reading up on computer stuff. That didn't get very far, but it did lead to a renewed interest in my engine. Hearing about old friends releasing their own games didn't hurt. Plus, one of my friends has a PS4 and it's been a struggle for him to find local multiplayer games, so I figured there's a market there...

Here's the thing. I used to work in Visual Studio, but now I want to start working in Ubuntu, so I've been converting my engine over to work with makefiles. It's actually been fun so far, but I've found myself wanting to change a lot of things in the engine itself, which has slowed things down a lot. Plus I want to go through and integrate unit tests into everything. So right now it looks like it's going to take a lot of work to get the engine actually running at all again, but hopefully when (if) it's done it will be more modular and more portable. Which is important if I ever get to the point of actually trying to produce something that other people can play.

What about game ideas? Well, I've had a few small ones. Nothing major, just small tweaks on standard formula, but it's all stuff that sounds fun to me and hey, it's a start. I'd love to be able to start posting about my engine again on this blog, so hopefully I can build up and sustain some momentum for a while. Fingers crossed.

Thursday, August 4, 2011

Time off for good behaviour

Got a holiday coming up, finally a chance to play some games!

I picked up a new matt varnish, I've been trying a couple of experiments with it. I've painted a base, coated half in gloss varnish, then (after leaving it a full 24 hours to dry of course) brushed on strips of varnish of varying thickness. So far it's looking good. Whether the varnish is thick or very thin it seems to give a nice matt. Watered-down varnish gives a slightly shiny finish that is uniform (it looks the same on both the gloss and bare paint), so I guess I won't be watering it down unless I'm after a satin finish. But hopefully I won't need to since a thick layer does not seem to go shiny the way other varnishes have.

But just to be sure, I've left the base on a window sill that catches the sun on sunny days. When I get back from my holiday in a month's time, I'll see how the varnish has held up. I obviously won't be doing any painting in the meantime.

I haven't done much painting in the last month, partly from being busy and partly from feeling a lack of enthusiasm. The varnish problems are a part of it, and the recent problems with unbalanced codices I'm reading about online is also a factor. Anyway, I tried an acrylic varnish remover on a clouded Crimson Fist model, but it didn't work (it helped a bit but then started taking the paint off the edges while there was still cloudy varnish on the flats - I suspect it's really meant for flat paintings). I also tried olive oil with limited success.

About the only progress I made was to strip the paint from my Harker model that I've been using to experiment with painting skin. Though I have yet to find a method that really works for me, Harker had lost all definition. I'm trying a new method on another model, but it'll have to wait until after I get back. I tried to strip the paint from the glowing Grey Knight, but for some reason I'm having trouble getting it all off.


I did however help my cousin paint a skeleton. It's her first mini, and I think it came out very well - I couldn't do much better myself. She seemed to enjoy it, I tried to show her a balance of techniques - hopefully enough to make it interesting and not so much that it bored her. The design on the shield is a stylised M, by the way.



In other news, work on my game engine has been progressing. Luckily the trouble with my arm turned out to be unrelated to the use of my laptop on the train, so I can keep working. I really want to get to the point where I have visible progress again, but it's looking like that will take a while. So for the forseeable future, I won't have any screenshots. That doesn't mean that I'm not getting anywhere though.

Monday, December 20, 2010

Progress

I've been doing a little work on my engine these past couple of weeks. I wrote two different forwards renderers, but they both have trouble with the same bug in GLSL that I keep running in to; trying to access light data using a uniform variable just kills the whole shader. No error messages, it just doesn't do anything. I'm not really sure what to do about that, friends are suggesting switching to CG instead of GLSL, I might have to look into it.

Meanwhile I've also made some changes to my asset management code and put some more work into my Blender plugin. I cleaned it a little and added a material file exporter, I'm hoping that soon I'll be able to export most or all of the files used by a typical object in one go - currently I have to manually export each file. I'm starting to fill the screen a little vertically, I'm still undecided on whether to keep everything on one screen or use a lot of pop-ups for options:


In related news I'm looking forwards to the new Sony gaming phone; the Zeus Z1 they are calling it right now, though the theory is it will be called the playstation phone or something to that effect. Finally, true gaming controls in a phone - plus it has a touch screen so it can handle all the "casual" games currently out. I hope to be able to port my engine to it, perhaps that will give me a more tangible goal.

Wednesday, September 1, 2010

Realism in games

There's many unrealistic elements of video games that we happily ignore, either because we know it's too difficult (or just not worth the effort) to make it more realistic, or we know that making it more realistic would not make it better, often it makes it worse.

But to an extent that's subjective - some people like realistic but complicated games, at least in certain genres. Take flight simulators for example. I think it's abaout gameplay first, but if an effective gameplay mechanic is also realistic, that can help immersion and enjoyment. Take for example the way current shooters often limit the number of weapons you can carry while older games generally allowed you to walk, run and jump while carrying many times your body weight in firearms. Limiting your carrying capacity wasn't done just because it was more realistic; it was and is done because it forces you to make strategic decisions about which weapons to carry. In some games this is an advantage.

So whenever we look at something unrealistic in a game, we have to consider if it needs to be improved or whether we should just maintain suspension of disbelief. However, today I had an idea that just might work.

In most shooters, when you reload a half-empty clip you don't lose the ammo that you dump (even though you clearly see it drop). This makes sense. But consider: if you tap the reload button in the middle of a firefight you drop the clip and reload as quickly as you can, losing the rest of the clip (though it falls to the floor and can be picked up later). If you hold the reload button you are treated to a more longer animation in which the character removes the clip, visible stowing it away thus keeping the ammo, before replacing it. This combines realism with an added layer of tactical decision making in-game. I think, for a modern-day shooter like Counterstrike, this could work. I'm planning to try it in my game anyway.

Of course it still doesn't explain how the ammo is consolidated from the half-empty clips into full ones, but hey; it's just a game. Right?


Also, I'm starting to suspect that I talk too much.

Tuesday, August 24, 2010

Animation more sorted

That thing I said yesterday about the exporter only exporting a single pose at a time? Solved. Actually took much less work than I expected, and now I can export an entire animated action in a single file. Might have to tweak it later after I tweak how the engine handles animation of course, but that's the nature of the work. It's an iterative process.

Monday, August 23, 2010

Animation sorted

I recently started to spend time on my engine again, and have finally solved the issues with importing geometry and animations from Blender. There were some problems before that I had not noticed because I had not tested enough, but things seem to be running quite well now. I've also cleaned up the code a bit, and improved the export scripts, making them more user-friendly. The animation export script currently only exports single rig poses though, so the next step will be to export an entire "movement" in one go. After that I think I'll look at graphics again, try to throw in some fancy effects.

Current progress:

Bind pose

Posed bones. It may not be obvious, but this is supposed to happen.

Monday, January 11, 2010

Bones! Jim!

I've been spending a bit of time on a skeletal animation system. I've written the core of the bone, rig, and animation classes, so now I can animate a rig. The next step is to bind vertices so that I can animate actual models, followed by writing tools to export the data from a modelling package (or load or convert from an existing format, whichever I decide is easier).

The problem is thus; the way I planned to animate the vertices will not work because of the data format. Either I change the format with much effort and lose any hope of getting the engine to work on the PSP (admittedly a rather distant hope at this point), or I use an unpleasant and inefficient work-around. So for now I'm putting it off, hopefully I'll get the chance to do some reading and maybe I'll spot something that I'm missing.



Friday, November 6, 2009

Brave new chicken

I've not really done any programming recently, which does not make me happy. The last thing I completed was some edge-polygon intersection code for the mesh splitting system. While I was testing this I ran into some issues that I had faced before in my previous mesh splitting system. The thing is, the last time I chickened out due to time constraints and went with a simpler version. This time, however, I shall try to keep hacking away at it and see if I can't implement the full system that I failed to complete last time. But I'll be doing it bit at a time while I work on the other parts of the engine, which of course I'm barely working on since I'm hella-busy with work and since I've just taken up painting Warhammer 40K miniatures, which I'm almost stunningly slow at. Seriously, I'm still working on my space-marines starter pack. Hopefully someday I'll get around to those Grey Knight Terminators that I just couldn't resist buying.

Thursday, October 8, 2009

Killing time

Right now I'm putting off starting any major jobs on my engine, mainly because I need to spend more time with Blender but don't want to because I'm currently trying to learn 3D studio Max (and other softwares) for my job. Until I can start working on the animation system, I've been spending a little time integrating my old mesh splitting system using the new mesh format I'm using. This has given me a chance to experiment with a pattern of code organisation I thought up. Basically, there are some functions that I may use often in areas that aren't speed-critical, but will also need on rare occasion in very speed-critical areas. This may seem obvious to most people, but I've never seen it in use and so I'm kind of happy with the idea, but basically what I do is write the function as an inlined function, but also have a non-inlined version that just calls the inlined version. For example:

int calculateThing(int i1, int i2);
int calculateThingFast(int i1, int i2);

inline int calculateThingFast(int i1, int i2)
{ ***blahblahblah*** }

int calculateThing(int i1, int i2)
{ return calculateThingFast(i1, i2); }


Now, assuming that the compiler actually inlines the function properly (not sure how to check on that, if anyone knows how to make sure it does actually inline the function please let me know), I will be able to inline the function where needed and call it normally where needed. By the way, if anyone knows a better way to do this, by all means let me know.

Anyway, I've written an infinite plane cut class using inlined line-test functions, which curently tests edges against a plane (it is also capable of figuring out if the ends of the edges are exactly on the plane, which I will need later). Here's some sample images. The plane is represented by a square with a red dot representing the center (or a point on the plane) and a fading line representing the normal. Since the plane is of infinite size, the size of the square is not relevant.
The red dots signify that the plane is intersecting the exact ends of the edge. While it isn't obvious, the bottom edge, which is parallel to the plane and therefore fails normal line tests, is correctly being handled, and the two ends of the edge are being marked as exactly on the line.

Now a normal line test against the two upright edges.
The top of the edges are being detected as exactly on the edge.

So some progress is happening, next I want to work on a finite, circle-shaped cut, then a convex polygon cut. Once that is done, the next step is to start handling the different possible cuts, then triangle sorting, new face generation, handling transforms etc. Of course in the long run it has to be integrated with the model format rather than the current simple mesh, as well as needing to work properly with the animation system (a problem I never solved in the past) which doesn't even exist yet... basically it's going to take a while, and I'm busier than ever now. Still, I shall try to keep at it. Wish me luck.