Chess Clock, Python, SDL's and Global Animation

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Re: Chess Clock, Python, SDL's and Global Animation

Postby Christopher » Sun Mar 03, 2013 2:33 pm

Does your class name and the filename match? If they do I have no idea what's wrong. Sometimes this also happens to me, but I don't know why.

Christopher
User avatar
Christopher
 
Posts: 276
Joined: Mon Jul 19, 2010 3:25 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Sun Mar 03, 2013 9:40 pm

So far My chess clock has been an epic failure, im getting this undeniable urge to marinade this python in teriyaki sauce throw it on the grill and eat it with some chopsticks (if I can remember how to use them)
Ill save the mesh for the clock, maybe i'll hang an out of order sign on it, and start working on texturing one of my Gazebo's that might make a nice addition.
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Mon Mar 04, 2013 2:16 pm

Coding was never my strong point which may have something to do with why I could not get this one working,
It was a bit more complex then I had anticipated. I tried several methods to get it working listed earlier in this thread all met with limited success.
Id like to thank every one who tried to help out and apologize for any sarcasm that may have been perceived.

If any of the coders would like to take a crack at the chess clock
let me know, I still have it in the Chess age, we can add it as a prp file depending on what programs your using.
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Jojon » Sat Mar 09, 2013 1:18 pm

If Plasma indeed allows a 12 hour animation, you should have no problem getting it working with only regular responders.

I gave it a go with PyPRP, but it seems Blender has a 300,000 frame limit on animation curves, which gives me a maximum of roughly two and three quarters of an hour (I made my test with a seconds hand and a minute hand, instead of the proper time spans) -- how high Plasma's limit is, I do not know.

As far as I can tell, the hands stay pretty well in sync, as long as you have a bunch of key frames in there and don't rely solely on Plasma's interpolation.

If you can't have animations that long, you may still be able to get away without any Python, if you don't mind the hour hand not crawling perfectly smoothly (which nobody may notice anyway, since it's so slow) - just set up any desired number of callbacks in your minute hand animation (the more the "smoother") and have each and every one of them send an increment message to the hour hand animation (hmm, maybe I should have given that a test, before suggesting it.. :P EDIT: ...well; I couldn't, I suppose - PyPRP doesn't do animation markers :7).

What I am curious about, is what sort of interface you have in mind for the players to set the clock... Buttons for a few presets? Plus and Minus buttons?
Attachments
chessclocktest.rar
This age uses the GenericAge template age prefix: 59382. You may want to check that you don't already have another "GenericAge" installed before overwriting it with this. (EDIT: click on the clock faces to switch)
(14.49 KiB) Downloaded 270 times
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Sat Mar 09, 2013 2:25 pm

I was actually gonna try 3 presets with three buttons in back. A 30 minute game, 60 minute game, and a 120 minute game. I had two pressure plates to start one clock and stop the other, and two flags.
To start the the game the players pick one of the buttons in back to set the clock, both flags would go up, player one would step on their pressure plate, to start player two's clock player two would have the first move, when done player two would step
on their pressure plate stop player two's clock and start player one's clock then player one would move and so on. who ever ran out of time first their flag would go down and the player with the flag still up wins. It got a bit complex and although
I had it figured out in my head, the interface between my imagination and Max/Plasma still needs a bit of work

the problem I was having is no mater what I tried I could never get the timing on the animation correct, I had the pressure plates working but since I could not get the timing correct I never got to the presets or the flags
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

Re: Chess Clock, Python, SDL's and Global Animation

Postby Tsar Hoikas » Sat Mar 09, 2013 7:37 pm

MOUL animations are limited to static_cast<uint16_t>(0xFFFF) frames at 30fps. Assuming I did my math correctly, that's somewhere over 18 hours. It's important to note that for anything designed for the current MOUL engine (this means ALL 3ds Max ages, even if you drizzle it), you must place keyframes on whole number frames. I am devising a fix for that limitation now, but it will require a complete reexport of every age by Cyan... So take that as the gospel for now.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Chess Clock, Python, SDL's and Global Animation

Postby Jojon » Sun Mar 10, 2013 1:25 pm

Thanks, Adam.

Hmm... "Just" an unsigned int... That should be little over half an hour, I think (...assuming that's total framecount and not just the seconds, with the "frame" fractions in a second variable); Yet I left the clock in the test age on for an hour and it kept keeping time just fine, past 36.4 minutes...
Maybe it just kept interpolating using the same vector, past overflowing, or maybe there was a downgrade between POTS and MOUL, so that it just happens to work in the former, but not the latter? :P

Regardless of what the interpolation routines work with, I do notice that the POTS PRP:s, that I load and display in PrpShop, preserve any "frame" integer value larger than 2^16, that I enter and save, and that "frametime" values appear to be floats...
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby Tsar Hoikas » Sun Mar 10, 2013 3:29 pm

Weird. You are right that the animation has a technical maximum of 36.4 minutes long. I have no idea why yours worked though. The current MOUL exporter only exports the short frame time. That represents a permanent loss of data in some situations :(. All other versions of Plasma export a float frame time (in seconds). PotS and lower export the frame number in addition to the time.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

Re: Chess Clock, Python, SDL's and Global Animation

Postby Jojon » Sun Mar 10, 2013 11:52 pm

Ah, POTS here - I guess that accounts for it.

So; I suppose, then, that the MOUL-target 3DSMAX exporter maybe peeks for keys on specified frame positions and is blind to any in between, rather than listing them all and rounding or truncating read positions... For-to+Peek, as opposed to Foreach, so to speak...
Jojon
 
Posts: 1116
Joined: Sun Sep 30, 2007 5:49 am

Re: Chess Clock, Python, SDL's and Global Animation

Postby Karkadann » Tue Mar 12, 2013 2:15 pm

All this technical jargon is a bit foreign to me, Im wondering if would help to post the Max file for the clock?
If you guys are still interested in helping me get this thing wired up properly.

As far as the Chessclock test the minute and hour hand were timed right in that one rotation of the minute hand equaled one twelfth rotation of the hour hand but it was going to fast.

with a technical max of a bit over 30 minutes for the animation I think we may be able to rig up a one hour game
I Don't Have A Cell Phone, I have Freedom!
User avatar
Karkadann
 
Posts: 1224
Joined: Sun Aug 02, 2009 10:04 am
Location: Earth

PreviousNext

Return to Building

Who is online

Users browsing this forum: No registered users and 5 guests