Show us yer programming projects!

Coders forum. Discuss techniques, swap code snippets, ask for help etc. relating to all forms of software development.
Post Reply
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: Show us yer programming projects!

Post by Dio »

After lying awake half the night thinking about it I think a 2000kbps (flat-rate) loader that offers up 3/4 of the time for other use in blocks of 1300 +- 100 T states is viable.

Bugger, I'm going to have to give this a go now aren't I?
User avatar
fog
Baaaaaaa!
Baaaaaaa!
Posts: 6022
Joined: Sun Jan 30, 2005 1:08 pm 0
XBL Gamertag: Dense Fog
PSN: DenseFog
Location: Newcastle, England
Contact:

Re: Show us yer programming projects!

Post by fog »

Mark wrote:Edit: I've just checked out the original game's Immelman. Not quite as slick as I remembered it...
These things never are. The old memory can't be trusted :)

Anyway I'm looking forward to whatever you come up with. It's a strangely overlooked sub-genre.
User avatar
pocketfun
Baaa!
Baaa!
Posts: 214
Joined: Sat Feb 07, 2004 11:23 am 0

Re: Show us yer programming projects!

Post by pocketfun »

OK screenshot and a teaser trailer for my latest.

Image
User avatar
Mark
Baaaaaa!
Baaaaaa!
Posts: 3611
Joined: Mon Apr 22, 2002 7:53 pm 0
Location: England

Re: Show us yer programming projects!

Post by Mark »

fog wrote:
Mark wrote:Edit: I've just checked out the original game's Immelman. Not quite as slick as I remembered it...
These things never are. The old memory can't be trusted :)

Anyway I'm looking forward to whatever you come up with. It's a strangely overlooked sub-genre.
Having said that, I can see the thinking behind the original now. I've spent a fair while tweaking and adjusting roll and loop speeds, tried overlapping them slightly to make it more natural, added ease-in and out where necessary, all to try and get it looking as slick as possible. I never quite got it working how I wanted, but then I realised that it sucked anyway. Took way too long to just turn the bloody ship around, and it's a game where you're going to want to do that an awful lot. Perhaps that Braybook chap knew a thing or two after all. ;) So, I've stripped most of it out and doubled the speed everything happens. It plays better, but doesn't look as good, and yet still probably isn't snappy enough for my liking. Will return to it later to see if there's a better solution. I may well end up stripping it out completely and just flipping the ship if need be. I'm contemplating adding a full roll as an evasive move instead to compensate - it does look rather nice in 3D, and might help justify the stupidly-high polygon count in the ship.


Whilst contemplating what to do with the front-end I considered chucking a 3rd-person fly past of a dreadnought in the background. I'm probably not going to do it after all, but it's such a quick thing to test I had to give it a go:

Benevolent Dictator of Bearcat Games
Twitter: #BearcatGames
User avatar
fog
Baaaaaaa!
Baaaaaaa!
Posts: 6022
Joined: Sun Jan 30, 2005 1:08 pm 0
XBL Gamertag: Dense Fog
PSN: DenseFog
Location: Newcastle, England
Contact:

Re: Show us yer programming projects!

Post by fog »

Mark wrote:
I'm liking that. Leave it in as an option. :) It's weird seeing a shmup from that angle mind as the lack of momentum as the ship turns looks really unnatural.

And I'm really tempted to have a go at a horizontal scroller next now.
User avatar
KlaxonCow
Baaaaaaa!
Baaaaaaa!
Posts: 8447
Joined: Fri Dec 13, 2002 3:46 am 0
Location: A large grassy field.

Re: Show us yer programming projects!

Post by KlaxonCow »

Mark wrote:
I would love to see the camera do an Immelman roll from that perspective, though. :wink:

It'd probably be vastly too confusing and vomit-inducing for actual gameplay, mind you - especially if you need to do the kind of crazy manoeuvres that you often had to do in the original, where you flip directions multiple times to get past a couple of big walls next to each other and the like.

You could perhaps make the camera just spin around 180 degrees - without any mad flipping over - to move behind the ship as it does the Immelman, which would produce a pretty mad sequence (see YouTube video below, which essentially does this).

But, basically, I can see the intrinsic problem of this perspective and why you'll have to rule it out. Simply, you can't see what's behind you properly and if you need to flip the ship in the other direction, then you're essentially doing it half-blind all the time.

It would look real nice, perhaps, but the gameplay would be decimated and probably be totally unplayable.

Which brings up the concept of the ship never flipping around to go backwards at all and just moving constantly forwards - but this means it immediately ceases to be Uridium gameplay-wise and it's now more like, I don't know, 3D Xenon or something. It'd be a completely different game to play if you can't flip back the way you came and this would also affect the kinds of obstacles that you can place on the ship (and the whole "land now" thing goes right out the window too - and possibly being able to control your speed at all, because if you go too fast and you speed past something, then, as you're not allowed to go backwards anymore, you've just missed it completely, never to be able to get back to it. The gameplay is just suddenly unrecognisable as Uridium).

I mean, retro-based 3D animations like the following look exceedingly cool - especially when the camera spins around - but how the hell do you make something like this actually playable, when the camera does mad flips and spins in the midst of the action?



Well, I'm convinced that, basically, this has to be essentially top-down perspective to work properly gameplay-wise - but let's consider other possibilities just to see if there might be a half-way house solution that could work.

Hmm, you could take a Zaxxon style perspective (but real 3D rather than isometric 3D fakery), so it's half-way between 2D and 3D somewhere:
Image

But that's still going to be a bit awkward to play (never liked Zaxxon for its control method anyway) and though the reversing direction issue is mitigated to be less of a problem than a full-on 3D perspective view, it's not entirely eliminated. There's also the issue that objects that project up from the ship can obscure gameplay elements (e.g. if you crashed into a wall from behind, then you'd just see an explosion come out the sides, but not actually see the ship hit).

Or another possibility is to just slightly tilt the top-down view to get some 3D perspective:
Image

Which might be the nicest compromise. It's only a slight tilt from the top down view, so, really, the gameplay isn't greatly affected by the minor cosmetics. But you're getting a touch of "side view" perspective too, to bring out the 3D nicely (a bit like those parallax scrolling grounds you had in games like Shadow of the Beast or the ST / Amiga version of Wizball, except that the whole playing area does this, not just a small strip of the screen).

A kind of 45 degree angle somewhere between the traditional top-down view of shoot-'em-ups and the traditional side view of platform games - so you get the best of both worlds. Well, it's probably best not to make it exactly 45 degrees in this case and bias it a little more to the top-down than the side-view, so that it plays well (and using up / down on the joystick to move across the width of the ship makes intuitive sense and feels right).

It's always kind of surprised me that no-one has ever really made much use of a 45 degree perspective like this. I guess it's because it was not possible on older machines with 2D graphics, and once you've got machines capable of proper 3D graphics, the temptation is to jump immediately to the full-on first person perspective view with "360 degrees of freedom", that the idea of "fixed 3D views", so to speak - that is, the traditional 2D restricted face-on views but rendered in 3D - were just skipped over and ignored.

Indeed, your first video with a top-down view but rendered in 3D is just something that's generally neglected as a possibility and, consequently, as has been mentioned in the thread, no-one much does anything in this subgenre anymore. Because it tends to be either traditional flat 2D or full-on first person 3D, in a very binary "either..or" fashion, and the various "2.5D" possibilities that exist in-between have been forgotten about and overlooked.

(Well, as always with my suggestions, it's only a suggestion. If it sounds like it'll be shit to you, then feel free to ignore me. It's just the game designer / problem-solver in me that whenever I see an "issue", my brain kicks in automatically to try to solve it - and I share it on the off-chance it might be useful. If it ain't, then, well, que sera sera.)
"Words ought to be a little wild - for they are assaults of thought on the unthinking."
- John Maynard Keynes
User avatar
Mark
Baaaaaa!
Baaaaaa!
Posts: 3611
Joined: Mon Apr 22, 2002 7:53 pm 0
Location: England

Re: Show us yer programming projects!

Post by Mark »

KlaxonCow wrote: I would love to see the camera do an Immelman roll from that perspective, though. :wink:

It'd probably be vastly too confusing and vomit-inducing for actual gameplay, mind you - especially if you need to do the kind of crazy manoeuvres that you often had to do in the original, where you flip directions multiple times to get past a couple of big walls next to each other and the like.

You could perhaps make the camera just spin around 180 degrees - without any mad flipping over - to move behind the ship as it does the Immelman, which would produce a pretty mad sequence (see YouTube video below, which essentially does this).
I'd love to try a chase cam during Immelman turn - but it would probably require me rewriting the camera. It's currently using vectors, and I'm already using one massive dirty hack to prevent gimbal lock in the little bit of roll I have in the camera as it stands. I do have some camera code that uses quaternions - I should perhaps look at using that as standard rather than vectors, but I'm still not entirely happy using something when I haven't the foggiest idea how it works. Also, my Immelman looks OK top down, but not so hot from other angles. The half loop half roll leaves the ship with a load of height to get rid of. Currently I just drop it vertically as quickly as I can (I did try doing something a little more elegant, but ran out of maths (technical term) so gave up). From above the current method doesn't look too bad. From most other angles though it looks nasty.
KlaxonCow wrote: But, basically, I can see the intrinsic problem of this perspective and why you'll have to rule it out. Simply, you can't see what's behind you properly and if you need to flip the ship in the other direction, then you're essentially doing it half-blind all the time.
Well, what's behind you is generally what was in front of you a couple of seconds ago, so it shouldn't be too bad - enemies notwithstanding. But, yeah, some of my plans (homing mines) would make this less than ideal for gameplay. It could be mitigated with a decent radar though, maybe. Still, a fun extra perhaps if it doesn't take too much work (there are a few other issues to consider such as vision distance, and culling of bullets that would have disappeared off-screen in the top-down version (and also the massive dirty hack that I mentioned earlier which required me to tell the view matrix routine that up is sideways for this camera mode)).
KlaxonCow wrote: Which brings up the concept of the ship never flipping around to go backwards at all and just moving constantly forwards - but this means it immediately ceases to be Uridium gameplay-wise and it's now more like, I don't know, 3D Xenon or something. It'd be a completely different game to play if you can't flip back the way you came and this would also affect the kinds of obstacles that you can place on the ship (and the whole "land now" thing goes right out the window too - and possibly being able to control your speed at all, because if you go too fast and you speed past something, then, as you're not allowed to go backwards anymore, you've just missed it completely, never to be able to get back to it. The gameplay is just suddenly unrecognisable as Uridium).
Yep. I definitely want the bi-directional aspect of Uridium. I'm not currently planning on using the "land now" thing though.
KlaxonCow wrote: Well, I'm convinced that, basically, this has to be essentially top-down perspective to work properly gameplay-wise - but let's consider other possibilities just to see if there might be a half-way house solution that could work.
After I tried the 3rd person camera I revisited the code to change the camera selection from an if..else to a switch statement, to make it easy to drop in a few experimental camera modes. This is one of the things I love about working with 3D, even for 2D projects - it's so easy to completely change the look of the game with a few tweaks to the camera.
Benevolent Dictator of Bearcat Games
Twitter: #BearcatGames
User avatar
_TinOmen_
Baaaa!
Baaaa!
Posts: 745
Joined: Wed Feb 12, 2003 10:52 pm 0
Location: Stockholm, Sweden
Contact:

Re: Show us yer programming projects!

Post by _TinOmen_ »

Dio wrote:After lying awake half the night thinking about it I think a 2000kbps (flat-rate) loader that offers up 3/4 of the time for other use in blocks of 1300 +- 100 T states is viable.
Bugger, I'm going to have to give this a go now aren't I?
Streaming content from tape for unlimited sequential memory access... That would be great, but how can it be used? A simple game with streaming content? Or perhaps displaying video in a 64x64 pixel window in 4fps? Anyway, if you write and share the code, I'm sure someone will definitely do something cool with it :)
User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: Show us yer programming projects!

Post by Dio »

Well, the time it offers up is free. It doesn't affect the rate of that design of loader (although what speed you choose defines the length of the blocks of CPU that the 'other code' has to implement).

As you say, the plan would be to build it and open it up for people to have fun with. I'd probably do something bog-simple like a loader Space Invaders as a proof of concept.
User avatar
evilpaul
Baaaa!
Baaaa!
Posts: 811
Joined: Wed Sep 29, 2004 2:01 pm 0
Location: #ukscene, helsinki branch
Contact:

Re: Show us yer programming projects!

Post by evilpaul »

Interesting idea. Fast tape loaders have of course been done, as have tape streamers.. now. I guess I'm saying "why bother"? But coming from someone who's just written a tape streamer I know that a valid answer is "because it's interesting".

I do think you will be the only person to use it though, so plan to write something more interesting than a proof of concept. Even if you do open-source this I'm unsure that anyone *would* use such a loader. There's are lots of people in the Spectrum community who would tell you they'd use it of course, but I suspect that most of them couldn't and/or wouldn't unless it's really simple plug-n-play. The people that do have the motivation (as well as the necessary skills and ideas) are probably off doing their own things already. Also, of course, no-one really uses tape any more.

The timing is the thing that will drive you (and others) mental. I used the normal tape speed for two reasons. Firstly because everyone knows how fast it is, and I wanted people to understand exactly what I was doing - using a different speed would have confused matters. Secondly, and more importantly here, it's very flexible and tolerant of timing errors. Those timing errors don't just come from the tape, but also from the time-sliced bits of code that run in the sync delays. I quickly learned that I don't need to time my code *exactly* to fit into the 358t-states *every* frame, as long as it's close enough most of the time. I imagine that with a higher speed there would be less tolerance for timing errors and you would end up having to cycle count a lot more. That way madness lies, especially when you start branching or loading into different areas (ie: speeds) of ram. Also, if there were less t-states available per time-slice then the set-up overhead of each one becomes more of a burden.

Anyway, if it were me.. I'd be tempted to make something like Deus Ex Machine, or even something Warioware like ;)

Some interesting links:
http://www.youtube.com/watch?v=TkSb9upLpXM
http://www.youtube.com/watch?v=9xZtsxOMgWg
User avatar
pocketfun
Baaa!
Baaa!
Posts: 214
Joined: Sat Feb 07, 2004 11:23 am 0

Re: Show us yer programming projects!

Post by pocketfun »

Teaser 2 including some gameplay fragments... Been fun putting this together.

User avatar
Dio
Sheepie Whore
Sheepie Whore
Posts: 18887
Joined: Mon May 31, 2004 1:08 pm 0
Location: Newcastle UK

Re: Show us yer programming projects!

Post by Dio »

evilpaul wrote:The timing is the thing that will drive you (and others) mental. I used the normal tape speed for two reasons. Firstly because everyone knows how fast it is, and I wanted people to understand exactly what I was doing - using a different speed would have confused matters. Secondly, and more importantly here, it's very flexible and tolerant of timing errors. Those timing errors don't just come from the tape, but also from the time-sliced bits of code that run in the sync delays. I quickly learned that I don't need to time my code *exactly* to fit into the 358t-states *every* frame, as long as it's close enough most of the time. I imagine that with a higher speed there would be less tolerance for timing errors and you would end up having to cycle count a lot more. That way madness lies, especially when you start branching or loading into different areas (ie: speeds) of ram. Also, if there were less t-states available per time-slice then the set-up overhead of each one becomes more of a burden.
The great thing with the pure FM method with is that if it works, the timing should be extremely open. If I've got a peak state change every N T states, I reckon I can do the state sample anywhere between about 1.2 and 1.8N to extract the data, and then lock back on with the next state change (i.e. the clock pulse bit). Effectively it's just a digital PLL. So at the standard 855 T state rate, anything from 1100 to 1400 T states should be just peachy - probably even enough time to do a single sprite. 3kbps transfer (about double standard spectrum speed, pretty similar to most Speedlock loaders) would still leave me a nice chunky window of something like 750-950T, that's probably what I'm going to target.

I have a massive advantage when it comes to debugging the timing: my own emulator and its very ninja debugger. I need to repair Emu's support for loading and save from wav file, so I can single step the loader and still have valid data present, but it used to do it anyway when it was the T2K emulator and the code's still knocking about.

But then I can then trivially add an extra external device that can be written to from the CPU and track the timing. Communicate by a standard IO port; first write starts the timing, second ends and supplies a timing window, device issues breakpoint if outside the window and lets me know how long or short the timed block was, guaranteed cycle accurate including wait states (at least, as long as the emulator's accurate!)

If that's a kind of facility you'd be interested in, I could let you have a drop of Emu if you want once I've got it all working?

I got the save routine running in half an hour or so last night, but that's the easy bit of course. Haven't got around to trying the load yet; I'm having conniptions over how to do the lock-on elegantly (separate pilot lock is for wimps).

Warioware is certainly intriguing. That would be a fantastic way to use the streaming concept. Likely to be rather beyond my meagre art skills though.
andy_h
Baaa!
Baaa!
Posts: 174
Joined: Sun Aug 23, 2009 6:19 pm 0
XBL Gamertag: andy_h77
PSN: andyh

Re: Show us yer programming projects!

Post by andy_h »



Today I've been experimenting with Javascript and drawing to the canvas element.
Nintendo Switch: SW-5294-9905-6499
User avatar
Devlin
Baaaaa!
Baaaaa!
Posts: 1380
Joined: Tue Aug 02, 2005 10:53 pm 0
XBL Gamertag: Anarkhis
Location: Bradford, Sacred Sod of God's Own County
Contact:

Re: Show us yer programming projects!

Post by Devlin »

andy_h wrote:

Today I've been experimenting with Javascript and drawing to the canvas element.
That looks pretty sweet.
User avatar
sdetoni
Baaaaa!
Baaaaa!
Posts: 1368
Joined: Tue Jun 18, 2002 4:14 am 0
Location: New Sheepland

Re: Show us yer programming projects!

Post by sdetoni »

Started off another project, this one may take for better part of 1/2 year to hack together. Basically its going to be a llamatron/robotron clone for the Nintendo DS. Decided to go down the sprite avenue and get the hardware to do all of the heavy work of rendering. Limitation 1 for this type of game, nds has only 128 sprites. Solution, use horizontal interrupts to reuse sprites when rendering the screen.
Downside is you are limited on the number of sprite that get rendered per line based on the sprites height and number used within hardware sprite registers. This is not a real problem with small sprites (8 pixels) as shown, more of the problem with larger sprites (32 pixels).

Quite chuffed that I actually got this to go and the whole thing in under 500 lines of code.

The example below uses 16 hardware sprites for 32pixel bitmaps (man, clearly under utilised in this example).
The oranges dots are 8pixel bitmaps using 32 hardware sprite registers. Leaving 80 hardware
sprites still available for use/reuse.

Image
Post Reply