Jump to content

Sign in to follow this  
bezo

Games4Cinema

Recommended Posts

Chess in c4d is not enough for you? Just try Tetris, Snake, Space Shooter, Minesweeper or Flappybird... 

...on french c4d forum (frenchcinema4d.fr) I just found very interesting project.

Maybe a lot of users knows about Safina3D plugins/scripts, which is also creator of these gems.

 

https://safina3d.blogspot.com/p/games4cinema.html

 

And what is most interesting of all these? You can check how it´s done. (xpresso, phyton with description etc...)

Safina3D ( aka "ksaa" user on frenchcinema4d forum) Thank you. 

 

(btw, also autor of very useful random vertex color script for lasts version of c4d.)

Share this post


Link to post
Share on other sites

I didn't know that. Haha. Thanks for the heads up! 
@jed actually made a mini game also. Remember that character where you can control its movement in real time?

Share this post


Link to post
Share on other sites

@bentraje here's a pinball game - you control the flippers with ctrl and alt (only tested on Windows). Sounds should be embedded.

 

pinball.c4d

 

I've found that with real-time games on C4D, the gfx card makes a big difference eg I tested my pinball on a 4770K using on-die graphics and it's really slow, but OK on main pc with GTX 1650 card.

 

I can dig out some other real-time stuff if anyone's interested.

 

For keyboard interaction, although most keys are already assigned in C4D, the modifier keys 'ctrl alt shift' are available. Code for this at Cineversity here.

Share this post


Link to post
Share on other sites
11 hours ago, jed said:

 

I can dig out some other real-time stuff if anyone's interested.

 

For keyboard interaction, although most keys are already assigned in C4D, the modifier keys 'ctrl alt shift' are available. Code for this at Cineversity here.

 

I'd love to see your other examples if you don't mind. I did some tests with game inspired real-time animation last year that I planned to use in a TV pilot. I the end I didn't use them but I think it's a promising to animate stuff. 

Share this post


Link to post
Share on other sites

It's not really games, I just sometimes make scenes where I can drive stuff around the viewport. I first got interested in this when C4D dynamics improved with motors, car steering etc. You can easily make XPresso car steering with user data controls, but it works better with ctrl alt as L/R. Here's a Hummer with Python steering

offroad.zip

 

This stickman on a unicycle has steering and auto rebound at the edges of the floor. It uses the base80 wheel to get correct wheel rotation

unicycle.zip

 

in this clip I swapped manual steer for a bit of Python random

 

these 2 sphere rigs need the RollIt plugin from

https://eggtion.net/en/blog/cinema4d-en/roll-it-2017-en/

cafesphere.zip

 

this BB8 character has steering + caps lock for stop/start because his head wobbles when he stops 😁

https://www.dropbox.com/s/739vsj622vlht77/bb8.zip?dl=1

 

Today when I dug these files out, I noticed that sometimes the ctrl or alt keys seemed to 'stick'. After swapping keyboards and trying different pcs I deduced that it's possibly an R21 bug. YMMV, but if one of the objects goes round in circles, just hit the key again.

Share this post


Link to post
Share on other sites

Thanks for the examples. I'll analyze them with attention this weekend. I think they'll give some inspiration for my next project. 

Share this post


Link to post
Share on other sites

Hi @jed
Just played it. That was fun, specially when the object lights up when the ball hits. 

Just wondering, is there a way to have a counter on it? 
I was thinking of adding a scoreboard. So for every light up is a one point. 

Share this post


Link to post
Share on other sites

You can keep a running total frame to frame by writing to user data and reading it back. In this file I used a one shot monoflop duration 0F to clean up the triggers -

 

pinball2.c4d

 

score would look good in Digital Readout Upright font

 

score.png.cb5e9a3658e13cfab0db7be339d30101.png

Share this post


Link to post
Share on other sites

@jed

Thanks for the file. Works as expected.  
The "writing to user data and reading it back" was certainly new to me. 

Thanks for pointing it out with the use of monoflop. 

Have a great day ahead! 
 

Share this post


Link to post
Share on other sites
47 minutes ago, bentraje said:

The "writing to user data and reading it back" was certainly new to me. 

In programming you often need to loop output back to input. This is not allowed in XPresso, but can be done with user data.

 

This file uses the same principle to read the length of a string and insert the length into the actual string. Change the words and refresh the viewport 😀

string_length.c4d

 

Share this post


Link to post
Share on other sites

@jed

RE: "In programming you often need to loop output back to input. This is not allowed in XPresso, but can be done with user data."
This was main problem in the previous project. I can't really do a: 

objA = Variable + objA 
because it has a weird behavior on a python tag or xpresso node. (i.e. cyclic performance since the python tag/xpresso node gets evaluated every draw) 
That monoflop node is really an eye opener to me. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

Latest Topics

Latest Comments

×
×
  • Create New...