The Icon Bar: The Playpen: Slightly cold news on page 10! Phlamey breaks the server.
|
Slightly cold news on page 10! Phlamey breaks the server. |
|
This is a long thread. Click here to view the threaded list. |
|
Jeffrey Lee |
Message #101430, posted by Phlamethrower at 23:33, 16/4/2007, in reply to message #101398 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
New converter is halfway there... I haven't tested it yet, but it should be able to load a drawfile and convert the different components into 24bpp sprites. Now I just need to write the scaling & palettisation code - I've got the basic algorithm worked out (including a better way of deciding whether a pixel should belong to a remap block or the 190 static colours), but haven't written anything yet. I also need to steal a suitable palettisation algorithm from somewhere
I might also put in a hack to allow it to work from a taskwindow, where it just draws the drawfile over the screen instead of redirecting output to a sprite. |
|
[ Log in to reply ] |
|
Phil Mellor |
Message #101434, posted by monkeyson2 at 07:12, 17/4/2007, in reply to message #101430 |
Please don't let them make me be a monkey butler
Posts: 12380
|
I also need to steal a suitable palettisation algorithm from somewhere Intergif? |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101435, posted by Phlamethrower at 07:33, 17/4/2007, in reply to message #101434 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Could do, I guess. Looks like his code is borrowed from the JPEG group anyway
I could also write my own, but unless I do something more fancy than a median cut there would be little point. |
|
[ Log in to reply ] |
|
Phil Mellor |
Message #101436, posted by monkeyson2 at 08:20, 17/4/2007, in reply to message #101435 |
Please don't let them make me be a monkey butler
Posts: 12380
|
Nick the code? I was thinking you could just run the files through Intergif itself |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101437, posted by Phlamethrower at 08:50, 17/4/2007, in reply to message #101436 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
I was thinking you could just run the files through Intergif itself Can't do that - the palettes need to be constructed in a certain way for the car recolouring to work. |
|
[ Log in to reply ] |
|
Richard Goodwin |
Message #101462, posted by rich at 07:17, 18/4/2007, in reply to message #101437 |
Dictator for life
Posts: 6828
|
Just load the palette into the desktop, and screengrab that way?
(you'd need software to make 256 greyscale desktops load 256 colour palettes) ________ Cheers, Rich.
|
|
[ Log in to reply ] |
|
Phil Mellor |
Message #101463, posted by monkeyson2 at 07:24, 18/4/2007, in reply to message #101462 |
Please don't let them make me be a monkey butler
Posts: 12380
|
Run it through intergif, then reorganise the palette how you ant it, then run the image through intergif again, this time specifying the palette file? |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101464, posted by Phlamethrower at 08:06, 18/4/2007, in reply to message #101462 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Just load the palette into the desktop, and screengrab that way? Load what palette? I need to generate it first, remember
And once the palette is generated, making the sprites use it is easy.
Run it through intergif, then reorganise the palette how you ant it, then run the image through intergif again, this time specifying the palette file? That won't work. The palette needs to be formatted as follows: * The first two entries are used for transparency * The next 190 entries are free for general use * The next 32 entries are the first recolour block * The last 32 entries are the second recolour block
The recolour blocks are changed at runtime, and typically contain gradients of colour running from black to (some colour). If I was to use a general purpose palettisation algorithm, I could end up with the different sections of the palette being the wrong sizes - in particular there may be more than 190 'general' colours, which would prevent me from simply rearranging the palette so the entries are in the right order. I'd also have to find space for the two transparent entries, since (presumably) intergif (or whatever) won't know to create those, since I'll (presumably) be giving it a sprite with a mask (since I'd be wanting it to do the downsampling as well, and if I gave it a sprite without a mask and asked it to shrink it it would blend the edge of the sprite into the transparent colour, and all the cars would end up with pink outlines, or something).
Writing (or integrating) my own algorithm isn't going to be particularly hard. Chances are there will be under 190 colours in the general section anyway, so it doesn't matter if it doesn't do a world-class job of reducing the colours. The tricky part will be tweaking it so that it correctly categorises each pixel into the three main palette sections - and the only way that problem will go away entirely is if I go back to making cars by hand in !Paint, which in the long run will take a lot more time. And if the algorithm doesn't get it right, I can always tweak the images a bit afterwards, to remove the rogue pixels. |
|
[ Log in to reply ] |
|
Richard Goodwin |
Message #101486, posted by rich at 13:04, 18/4/2007, in reply to message #101464 |
Dictator for life
Posts: 6828
|
Just load the palette into the desktop, and screengrab that way? Load what palette? I need to generate it first, remember Well, seeing as you had one in the screenshot, excuse me for thinking you'd already got one!
Run it through intergif, then reorganise the palette how you ant it, then run the image through intergif again, this time specifying the palette file? That won't work. The palette needs to be formatted as follows: * The first two entries are used for transparency * The next 190 entries are free for general use * The next 32 entries are the first recolour block * The last 32 entries are the second recolour block You could quite easily design your vehicles with a standard palette (see below), push them through InterGif to force it to stick to the palette you've designed, and then later use recolouring to change from the default you'd designed it in to the one you want it to be in. Even the transparency still works if you say that (e.g.) magenta will always be mask, and back your designs on that. Don't bother using a sprite mask.
Whenever I designed a website template that I knew I needed in many colour variations, I designed them in ArtWorks in shades of grey; shades of blue if a second set of colours were needed; and shades of orange for a third set. I generated a palette using my handy palette editor, and used Photodesk to force the 24bit images into using this palette (you could use InterGIF). I then chopped the image into its component parts, saved them as individual 256 colour sprites, and used a BASIC program to recolour them, and also generate HTML and CSS with the same colour scheme.
The colour schemes were based on 16 colour palettes, which I also wrote an editor for, so it was possible with the right maths to get one design to work in 100+ colour schemes, and if I wanted more, I just created a new palette file, or tweaked the maths to create darker and lighter palettes, or ones with opposing colours (e.g. blue and orange/yellow). Finally, my program converted all the images to GIF using InterGIF.
Basically, so long as you have a bunch of vehicles designed all using (e.g.) the same greys and blues, you can always dick around with the colours at a later date. ________ Cheers, Rich.
|
|
[ Log in to reply ] |
|
Richard Goodwin |
Message #101488, posted by rich at 14:29, 18/4/2007, in reply to message #101486 |
Dictator for life
Posts: 6828
|
As a quick exercise, here's a palette that uses less than 128 colours, including 1 mask and 15 shades of grey. By moving the colours along by 9, you can get different coloured cars, but retain the greys.
If I actually designed it using 9 colours in the unused portion, and moved those colours down to use one of the 8 standard colour variations, I could also use some of the standard colours for things like orange indicators without those getting colour shifted.
Now, I'm not suggesting that this is exactly what you need; just that it only took a few minutes to work out something which might work, you slacker ________ Cheers, Rich.
|
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101492, posted by Phlamethrower at 15:04, 18/4/2007, in reply to message #101488 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Slacker!?!?!
I don't even have enough spare time to write a ranty reply to your false accusations! |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101493, posted by Phlamethrower at 16:41, 18/4/2007, in reply to message #101486 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Well, seeing as you had one in the screenshot, excuse me for thinking you'd already got one! Yes, but then I said I was going to rewrite the converter to generate the palette itself
You could quite easily design your vehicles with a standard palette (see below), push them through InterGif to force it to stick to the palette you've designed, and then later use recolouring to change from the default you'd designed it in to the one you want it to be in. Even the transparency still works if you say that (e.g.) magenta will always be mask, and back your designs on that. I could do, I guess. But I can never be sure exactly which colours I'll be needing, so having the code generate a palette for me would be nice.
As a quick exercise, here's a palette that uses less than 128 colours, including 1 mask and 15 shades of grey. By moving the colours along by 9, you can get different coloured cars, but retain the greys. Hmm, I never thought of using palette cycling. But then again I don't particularly need to use it, since the game can load in completely different palettes anyway (it's not limited to just remapping the two recolour blocks).
That car looks very car like. Want to draw some cars for me? I can provide examples and/or documentation. |
|
[ Log in to reply ] |
|
Tony Haines |
Message #101506, posted by Loris at 18:29, 18/4/2007, in reply to message #101493 |
Ha ha, me mine, mwahahahaha
Posts: 1025
|
I wrote my own paletting sprite plotter at the weekend. (Doesn't draw partial off-screens yet, which is always the hard part.) I'm using 16 colours: Transparent,black,white,'colour', Um...3 greys,grey/colour, 4*lighter shades, 4*darker shades
Deciding on that palette scheme was quite hard.
I'll probably have 12 of these palettes, plus a few bespoke ones for player characters etc.
My game will be very different to yours in pretty much every respect. Um, and thats all I'm saying, for now.
... Why don't you just draw your cars in one rotation at 2*magnification, then have your program generate the rotations at runtime by pixel-sampling? It won't look much crappier, and you don't have to fiddle with all that palettising etc. Or just pre-generate them this way, then tweek the rotated sprites by hand. I've done that before. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101509, posted by Phlamethrower at 18:56, 18/4/2007, in reply to message #101506 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
I wrote my own paletting sprite plotter at the weekend. (Doesn't draw partial off-screens yet, which is always the hard part.) I'm using 16 colours: Transparent,black,white,'colour', Um...3 greys,grey/colour, 4*lighter shades, 4*darker shades
Deciding on that palette scheme was quite hard. Any particular reason for limiting yourself to 16 colours?
My game will be very different to yours in pretty much every respect. Um, and thats all I'm saying, for now. Sounds good!
Why don't you just draw your cars in one rotation at 2*magnification, then have your program generate the rotations at runtime by pixel-sampling? It won't look much crappier, and you don't have to fiddle with all that palettising etc. Or just pre-generate them this way, then tweek the rotated sprites by hand. I've done that before. The game doesn't use rotated sprites.
*casts everyone's minds back about 15-20 pages*
- The game runs in a 16bpp mode - The cars are constructed from 256 colour sprites layered ontop of each other (to allow for doors opening, dents from damage, etc.) - Each car has its own 256 colour palette - Rather than drawing each layer individually each frame, the composite of the layers is cached (in a 16bpp sprite, for faster plotting) - This composite is then drawn using a plotter that can rotate and scale, since under normal gameplay conditions the rotation and scale of the car will change every frame, but the appearance will not change "very often" (i.e. less than once every hundred frames)
The choice of a 16bpp screen and 256 colour source sprites was of course rather arbitrary (Actually it was nicked from GTA 1/2). It's possible that there are better methods, but I think this setup works well. And it's the one that's already implemented |
|
[ Log in to reply ] |
|
VinceH |
Message #101511, posted by VincceH at 19:20, 18/4/2007, in reply to message #101506 |
Lowering the tone since the dawn of time
Posts: 1600
|
My game will be very different to yours in pretty much every respect. Um, and thats all I'm saying, for now. Stop it. You'll get me excited. |
|
[ Log in to reply ] |
|
Ian Cook |
Message #101516, posted by ilcook at 20:18, 18/4/2007, in reply to message #101511 |
Resident idiot
Posts: 1077
|
My game will be very different to yours in pretty much every respect. Um, and thats all I'm saying, for now. Stop it. You'll get me excited. That's easy to do. |
|
[ Log in to reply ] |
|
Richard Goodwin |
Message #101534, posted by rich at 08:57, 19/4/2007, in reply to message #101493 |
Dictator for life
Posts: 6828
|
Hmm, I never thought of using palette cycling. But then again I don't particularly need to use it, since the game can load in completely different palettes anyway (it's not limited to just remapping the two recolour blocks). Well, at least have some way of making cars change colours, as it'd be annoying having all the cars the same colour
That car looks very car like. Ta. I couldn't get the Akira screenshot to produce a good car in the five minutes I spent using Paint, so I typed "Corvette Stingray overhead" into Google images
Want to draw some cars for me? I can provide examples and/or documentation. Gah, to get all the projects I've got on the go finished I'm going to have to quit my day job!
Although I'm thinking of doing that anyway, so pass along anything you've got. ________ Cheers, Rich.
|
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101538, posted by Phlamethrower at 09:39, 19/4/2007, in reply to message #101534 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Want to draw some cars for me? I can provide examples and/or documentation. Gah, to get all the projects I've got on the go finished I'm going to have to quit my day job!
Although I'm thinking of doing that anyway, so pass along anything you've got. Do what - draw some cars or quit your job?
I'll see if I can get the latest stuff uploaded tonight. If not, then you should still be able to go by what's already there (game zip for a couple of sample cars, source zip for tools & a stronghelp manual). |
|
[ Log in to reply ] |
|
Tony Haines |
Message #101539, posted by Loris at 09:43, 19/4/2007, in reply to message #101509 |
Ha ha, me mine, mwahahahaha
Posts: 1025
|
...I'm using 16 colours... Any particular reason for limiting yourself to 16 colours? Well, yes. Since I only have one hue for most things, and will have 'cartoony' sprites, more seemed unnecessary. Plus I want it to go fast, and this a)reduces palette size, increasing caching, and b)reduces bitmap size. Plus I can't draw, so they're going to look like sh!t anyway. (I just went from 32*32 sprites on 640*512 down to 16*16 on 320*256 basically to reduce the sprite design time too.)
My game will be very different to yours in pretty much every respect. Um, and thats all I'm saying, for now. Sounds good! Well don't get your hopes up, I have an unfortunate habit of starting games based around some curious algorithm I've thought up, getting that working nicely then abandoning them.
The game doesn't use rotated sprites.
*casts everyone's minds back about 15-20 pages* Oh, yeah. In that case shouldn't you use 2x initial images then scale them, to make them look better? |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101541, posted by Phlamethrower at 09:48, 19/4/2007, in reply to message #101539 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Oh, yeah. In that case shouldn't you use 2x initial images then scale them, to make them look better? Possibly. But also see your arguments about not being able to draw, and reducing memory overhead/increasing rendering speed
The engine does run at a pretty nice speed now, but is still far from complete, and IIRC doesn't reach my (ambitious) performance goals for RiscPC's. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101601, posted by Phlamethrower at 22:40, 19/4/2007, in reply to message #101541 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Hmm, looks like quite a few bits have changed since the last release that would be useful for making cars. E.g. the car damage deltas working ingame, and a bugfix or two to the sprite converter utility. I'll see if I can tidy up the loose ends and upload the latest code... |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101602, posted by Phlamethrower at 00:05, 20/4/2007, in reply to message #101601 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
...and the latest code is now uploaded. Hurrah!
I think the new renderer is still a bit unstable though, as it did manage to stiff my Iyonix
*makes note to move the textures folder somewhere else, so it doesn't have to copy 270MB of stuff when preparing to package the game/source* |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101606, posted by Phlamethrower at 08:23, 20/4/2007, in reply to message #101602 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
A few notes about the style of the cars:
* Make sure the sprites are at the same scale to peds (peds are about 12 pixels wide, so most cars will be around 24-32 pixels wide). Also make sure the front of the car is at the bottom of the sprite * The game is set "sometime in the nearish future", so there'll be a mix of futuristic designs and present-day ones * For futuristic cars, I'm planning on sticking to the polygonal style as seen in a number of films (Total Recall, Judge Dredd, Akira, etc.). But if you can make a good car in another style then there's no reason why I can't include it * Cars should be done in a "higher points in a lighter shade" shading style, as used in GTA 2, as opposed to the specular highlights used in GTA 1. For example most of these cars are right, while most of these cars are wrong. Reasons for choosing "higher is lighter" over specular highlights include the fact that specular highlights look a bit silly when cars are facing different directions, and they imply a bright and sunny game, which this probably won't be. And IIRC they're a bit trickier to do * Don't limit yourself to just cars. Tanks, trucks, vans, military/emergency services, etc. are all needed. Bikes, boats, and perhaps helicopters too. I'll see if I can produce a few reference/test cars for the more exotic vehicle types, to make sure you can test them properly ingame, and to show you how to lay out the sprites. * Apart from regular cars with wheels there will also be hover cars/hovercrafts, so feel free to make a few more futuristic and hover-looking * Try and make use of both recolour blocks, to allow greater variety in the cars. E.g. racing stripes on sports cars, or camouflage patterns on vehicles that could make good military vehicles. If done properly these extra features can be turned on and off just by setting the two recolour blocks identical/different to each other. * Currently the recolour blocks need to be a gradient from black to (some colour), but in the future that might change, to allow for brighter highlights. |
|
[ Log in to reply ] |
|
Tony Haines |
Message #101608, posted by Loris at 11:07, 20/4/2007, in reply to message #101606 |
Ha ha, me mine, mwahahahaha
Posts: 1025
|
For example most of these cars are right... Um, why don't you contact the creators of those cars you like and ask if you can use them? OK, perhaps you'd have to go through the site owner first, if they don't give their email address. Maybe most would say no, but probably a few would be chuffed to have their stuff in a game, even for a tiny platform they're unlikely to ever see.
You'd probably need to give each car its own palette, and write a palette reordering utility if you wanted to recolour them, but that may well be a good thing anyway. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101609, posted by Phlamethrower at 11:30, 20/4/2007, in reply to message #101608 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
I think I looked through their car collections before, but didn't see (m)any that I liked. |
|
[ Log in to reply ] |
|
Michael Drake |
Message #101611, posted by tlsa at 13:23, 20/4/2007, in reply to message #101602 |
Posts: 1097
|
I think the new renderer is still a bit unstable though, as it did manage to stiff my Iyonix Stiffed my Iyonix after I walked a few paces towards the car. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101613, posted by Phlamethrower at 14:23, 20/4/2007, in reply to message #101611 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Try turning off sound, hopefully that will prevent it from killing the machine when it crashes.
It's probably some silly division by zero or something. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101625, posted by Phlamethrower at 13:22, 21/4/2007, in reply to message #101613 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
Yeah, there were loads of bits in the new plotter that didn't have safeguards against divisions by zero. I've uploaded a new copy that should work properly.
[edit]
Hmm, it just crashed again
Maybe I'd better look into moving the sound code into a module, so it doesn't bring down the machine when it crashes.
[Edited by Phlamethrower at 14:40, 21/4/2007] |
|
[ Log in to reply ] |
|
Tony Haines |
Message #101639, posted by Loris at 20:00, 21/4/2007, in reply to message #101625 |
Ha ha, me mine, mwahahahaha
Posts: 1025
|
Maybe I'd better look into moving the sound code into a module, so it doesn't bring down the machine when it crashes. Can't you just set your error routine to turn the interrupts you're using off? IIRC theres a guide or example code to do this somewhere, probably by Alain Brobecker or Eli-Jean Leyssens. |
|
[ Log in to reply ] |
|
Jeffrey Lee |
Message #101641, posted by Phlamethrower at 20:08, 21/4/2007, in reply to message #101639 |
Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff
Posts: 15100
|
I've tried that in the past, but have never been able to find an error handler that will get called under all situations.
*checks*
The current code installs a handler on ErrorV, which will remove the sound handler when there's an error. Although looking at the code, it also seems to remove the error handler, which could be confusing the OS and causing things to go horribly wrong. I'm not even sure if I've ever seen the error handler get used and save the machine
Perhaps I'd better check the PRMs. |
|
[ Log in to reply ] |
|
Pages (22): |< <
17
> >|
|
The Icon Bar: The Playpen: Slightly cold news on page 10! Phlamey breaks the server. |
|