UnderwareDESIGN

PlayBASIC => Show Case => Topic started by: kevin on February 21, 2006, 11:18:16 PM

Title: A little Rugby
Post by: kevin on February 21, 2006, 11:18:16 PM
Here's a bit of tech demo i've been working on.  Uses the same engine (sorta) as the 2D platformer in 3D camera tech demo from the other week.

Runs pretty good, even on the crusty old duron



Videos

Watch on youtube (http://www.youtube.com/watch?v=SZMH3IktajM)






Download

 2.5 Rugby Source (http://www.underwaredesign.com/forums/index.php?topic=2980.0)


Title: A little Rugby
Post by: Ian Price on February 22, 2006, 12:20:14 AM
"It's goooooooooooooooood!" Reminds me of John Madden's on Megadrive. :)

I presume the pitch is accidently incorrectly orientated? (the numbers kind of give that away :P).

Anyway, rugby [shudder] reminds me of cold, wet winter days when I was still at school - days when rugby boots were attracted to a boy called Dale like pins to a magnet...  :o

I can certainly see this folded plane goodness being used a fair old bit in the future. :D
Title: A little Rugby
Post by: kevin on February 22, 2006, 02:46:47 PM
Yeah the ground is back to front, will have to fix that i guess

 Anyway, here's some nicer player art.  Pretty :)
Title: A little Rugby
Post by: Ian Price on February 22, 2006, 02:50:36 PM
Excellent stuff, but I thought you'd be more into Oz rules football than rugby.

Speaking of which, are there actually any rules in Oz rules football? :P
Title: A little Rugby
Post by: kevin on February 22, 2006, 02:58:39 PM
QuoteExcellent stuff, but I thought you'd be more into Oz rules football than rugby.

True, I can't say I'm a rugby fan. To be honest, I've hardly even seen it.

Anyway, we've been approached to assess the viability of producing a small rugby game in PB.  From the design doc required, it certainly seems viable.  I dunno if it'll go any further though..

QuoteSpeaking of which, are there actually any rules in Oz rules
football?

Apart from don't die ? Erm, not really :)
Title: A little Rugby
Post by: Ian Price on February 22, 2006, 04:18:20 PM
LOL - That's what I thought :P
Title: A little Rugby
Post by: Digital Awakening on February 22, 2006, 04:35:56 PM
So if you do die you get some penalty? ;)

Anyway, that looks awesome :) Would it be hard to set up stuff like 3D walls?
Title: A little Rugby
Post by: kevin on February 22, 2006, 04:51:50 PM
Yeah, we've just been talking about that.   Going to throw in some mock up art and see how it'll look.  It should be fine on the far end, and with a little tinkering it should be ok left/right edges also.   The issue is that PB doesn't have a perspective correct texture mapping.  Since it was never designed to do such things.

The geometry in the world actually represents a 3D scene, but the output relies upon some fixed assumptions to make the illusion work.  The primary assumption is that the camera doesn't rotate. Which is what they want apparently.    In can change height and tilt forward and back. But that's about it.  Anything else would break it anyway.. :)
Title: A little Rugby
Post by: kevin on February 23, 2006, 01:06:32 PM
More WIP Screen shots with much nicer art work

Have added

 - goal posts
 - far stadium
 - alpha player shadows
 - alpha blended hud
Title: A little Rugby
Post by: Digital Awakening on February 24, 2006, 04:47:50 AM
This would be kinda cool to use for Archon Fields in the future.

I was thinking though, what about mouse interaction with these kinds of 3D planes? Would be nice it there where commands that check a 2D point "collision" with the 3D plane.
Title: A little Rugby
Post by: kevin on February 24, 2006, 10:40:03 PM
QuoteI was thinking though, what about mouse interaction with these kinds of 3D planes?

  Above is just good old fashion 3D geometry.  The viewer can view it from any angle/position you like.  However, in this case because the camera doesn't need to rotate,  i've translated the field into a list of rectangular quads.    Since the quads are not square and PB doesn't support perspective texture mapping the illusion is lost if the viewer attempts to view the scene from an arbitrary angle.  But If the viewer looks straight ahead the scene retrains the perspective illusion.

 However if the field was translated into a list of smaller square quads, you could view it anyway you liked.  There's a few exceptions though, the main one is clipping.   Since the current PB scene buffer/camera solutions only consider the uniform Z of any captured object, there's no provision for clipping the surface against the near/far planes.  So surface can't be partly in front/behind on the camera. There either in front or not.


QuoteWould be nice it there where commands that check a 2D point "collision" with the 3D plane.

 I assume you mean checking a ray against the geometry.   Which would be needed for picking polygons from a camera view say.
Title: A little Rugby
Post by: kevin on February 28, 2006, 07:19:06 AM
Colourizing  Player Sprites

In this pic i'm  test a method for colourizing a players uniform via code. Seems to work ok :)
Title: A little Rugby
Post by: Draco9898 on February 28, 2006, 10:50:28 AM
wow, how's that work?
do you just look at a series of colors on the players shirtsthen create different player images for every colour?
Title: A little Rugby
Post by: Digital Awakening on February 28, 2006, 02:11:00 PM
QuoteI assume you mean checking a ray against the geometry.   Which would be needed for picking polygons from a camera view say.
[snapback]9114[/snapback]

Yeah, that's pretty much all my post was about. Any rays planned?
Title: A little Rugby
Post by: kevin on February 28, 2006, 10:19:13 PM
QuoteYeah, that's pretty much all my post was about. Any rays planned?
[snapback]9231[/snapback]

 Yes, once more 3D-ism's are introduced (primarily a internal mesh format for starters) we can look at building 3D intersection functions in.
Title: A little Rugby
Post by: kevin on February 28, 2006, 10:43:22 PM
Quotewow, how's that work?
do you just look at a series of colors on the players shirtsthen create different player images for every colour?
[snapback]9224[/snapback]


The above builds a new coloured player from two copies of the original player image.


Image #1 is the original  player image

Image #2 is a mask of the player image. (the mask fits over the pixels that are to be coloured)  The Mask is drawn in colour Rgb(0,0,255) in this case and the rest of the image is black rgb(0,0,0).  Image #2 has it's transparent colour set to that of the mask colour.  In this case it'd be ImageMaskColour 2,Rgb(0,0255)


Both images are the same size


Steps,

Image 1 is copied a temp image.

Image #2 is drawn over the Temp image.  Which removes any unwanted pixels, leaving the jersey/socks (what ever you wanna colour) behind.

Convert the temp image to Grey Scale.  

Scan through the Temp image pixel by pixel, and multy each pixels RGB  by the a new colourize RGB value

To rebuild the image, either copy the TEMP back over the Image #1, or copy image #1 to a new image and then draw the coloured temp over that.   Which will leave your original image in tact..