Jump to content



Photo
* * * * * 3 votes

UltraDMD WIP


  • Please log in to reply
585 replies to this topic

#261 gigalula

gigalula

    Hummmm not sure yet :)

  • Platinum Supporter
  • 651 posts

  • Flag: Canada

  • Favorite Pinball: All of them from 70' to now. Even more with VP and FP :)

Posted 26 August 2015 - 01:37 AM

Here is the Script code for those who would like to add personal color for individual tables

 

Simply add this at start like this example for AMH

Option Explicit
Randomize
'---------- UltraDMD Unique Table Color preference -------------
Dim MyDMDColor
Dim MyDMDColorSelect

'Uncomment only the color of your choice

	MyDMDColorSelect = "Green"
'	MyDMDColorSelect = "Yellow"
'	MyDMDColorSelect = "Blue"
'	MyDMDColorSelect = "White"
'	MyDMDColorSelect = "Red"
'	MyDMDColorSelect = "Cyan"

'   If you need more colors simply add them manually
'   as long as they are supported by UltraDMD

GetMyDMDColor
Sub GetMyDMDColor
	Dim WshShell,filecheck,directory
	Set WshShell = CreateObject("WScript.Shell")
	MyDMDColor = WshShell.RegRead ("HKCU\Software\UltraDMD\color")
	If MyDMDColor <> MyDMDColorSelect then
'		MsgBox ("MyDMDColor =" & MyDMDColor & "   " & "MyDMDColorSelect =" & MyDMDColorSelect)
		MyDMDColor = WshShell.RegWrite ("HKCU\Software\UltraDMD\color",MyDMDColorSelect,"REG_SZ")
	End if
End Sub
'---------------------------------------------------


Edited by gigalula, 26 August 2015 - 01:39 AM.


#262 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,370 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 26 August 2015 - 02:02 AM

 

Here is the Script code for those who would like to add personal color for individual tables

 

Simply add this at start like this example for AMH

Option Explicit
Randomize
'---------- UltraDMD Unique Table Color preference -------------
Dim MyDMDColor
Dim MyDMDColorSelect

'Uncomment only the color of your choice

	MyDMDColorSelect = "Green"
'	MyDMDColorSelect = "Yellow"
'	MyDMDColorSelect = "Blue"
'	MyDMDColorSelect = "White"
'	MyDMDColorSelect = "Red"
'	MyDMDColorSelect = "Cyan"

'   If you need more colors simply add them manually
'   as long as they are supported by UltraDMD

GetMyDMDColor
Sub GetMyDMDColor
	Dim WshShell,filecheck,directory
	Set WshShell = CreateObject("WScript.Shell")
	MyDMDColor = WshShell.RegRead ("HKCU\Software\UltraDMD\color")
	If MyDMDColor <> MyDMDColorSelect then
'		MsgBox ("MyDMDColor =" & MyDMDColor & "   " & "MyDMDColorSelect =" & MyDMDColorSelect)
		MyDMDColor = WshShell.RegWrite ("HKCU\Software\UltraDMD\color",MyDMDColorSelect,"REG_SZ")
	End if
End Sub
'---------------------------------------------------

 

great work! slicker than an oil refinery



#263 gigalula

gigalula

    Hummmm not sure yet :)

  • Platinum Supporter
  • 651 posts

  • Flag: Canada

  • Favorite Pinball: All of them from 70' to now. Even more with VP and FP :)

Posted 26 August 2015 - 02:08 AM

Of course you could be able add a nice menu from F6 but i'm not enough good in coding script so I leave it to expert around ...Slowly but surely I'm getting use to it day after day ;)

At least now we have choice of DMD color for individual table it's better then nothing hehe :)


Edited by gigalula, 26 August 2015 - 02:09 AM.


#264 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 27 August 2015 - 02:24 AM

I want to display a bumper animation that continously updates the bumper hit count every time a bumper is hit, so I need to start the scene and then modify the scene if it is rendering.  I can do this with 

 

UltraDMD.DisplayScene00ExWithId 1, 0, "bumpers.gif", " ", 15, -1, "      " & BumperModeCount, -1, -1,14, 1000, 14
and then
BumperModeCount = BumperModeCount + 1
UltraDMD.ModifyScene00Ex 1, " ", "      " & BumperModeCount, 1000
 
to update the value while the original scene (sceneId = 1) is rendering.
 
Question - Is there a way to check if a the scene with sceneId = 1 is rendering, so I can decide if I need to call ModifyScene or DisplayScene (to start the animation)?  


#265 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 27 August 2015 - 04:20 AM

I don't think there's any sort of "IsRenderingWithID" function...  But what exactly are you trying to do?  Don't forget that the modifyscene00EX you used above resets the pause time to keep the animation going.  Also the ModifyScene functions don't do anything if that scene isn't rendering.

 

So, you can always call modifyscene without worry, it's just a matter of whether or not to call DisplayScene.  Do you want these bumper hits to interrupt every other animation?  Maybe you could implement some sort of priority system and make the bumper hits a special number.  In my AMH table, I have a priority system with 255 possibilities (although, that's only because that's what the original code used).  If a scene is called with a lower priority, it won't interrupt or get queued; if you start an animation with the same or higher priority, it stops the current animation and plays that one instead.  So let's say you advance a mode and the animation for that starts, and while that animation is going you roll over an ORB; you'll never see the ORB animation since it's got a lower priority.

 

Then, you could make the bumper animations have a specific priority number that isn't used anywhere else.  That way, you could have an if statement check to see if the current priority is the number that indicates it's a bumper animation.  So you'd have something like this:

Sub bumper1_hit()
  video "BumperAnimation.gif", "", BumperModeCount, 500, 163
End Sub

Sub LeftSling_SlingShot()
  video "SlingAnimation.gif", "", "", 200, 100
End Sub

Sub LeftOrbitTarget_Hit()
  video "ModeAdvance" & ModeProgress & ".gif", "", "" , 1000, 255
End If

Dim OldVidPrio
OldVidPrio = 0
Sub Video(whichAnim, topText, bottomText, pauseTime, priority)
  if OldVidPrio = 163 AND priority = 163 Then
    UltraDMD.ModifyScene00Ex 1, "", " " & BumperModeCount, pauseTime
  ElseIf priority >= OldVidPrio then
    UltraDMD.CancelRendering
    UltraDMD.DisplayScene00 whichAnim, topText, 14, bottomText, 14, UltraDMD_Animation_None, pauseTime, UltraDMD_Animation_None
  End If
  OldVidPrio = priority
End Sub

Then of course when you pull up your score board, or whatever you do when your animation pause time is over, you'll reset the priority.  You could make the 163 any number, so if you wanted the bumper animation to always interrupt, then you could make it 300 or something.  So, if the previous animation is 300 (which is still running since OldVidPrio is still 300, not 0) and the current animation is 300, then it modifies the bumper animation; but if the previous animation was not 300, then the bumper animation will cancel the current animation (since nothing is higher than 300) and start the bumper animation.


Edited by Shoopity, 27 August 2015 - 04:37 AM.


#266 gtxjoe

gtxjoe

    VPF Veteran

  • VIP
  • 5,152 posts

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness, AbraCadabra



Contributor

Posted 27 August 2015 - 06:24 PM

I will take a look at your AMH code as the priority based approach will be useful for other scenarios, but I don't think it supports the queuing of animation scenes, which I gues I am trying to take advantage of in this case  

 

Basically I was trying to do this but I don't think it is natively supported.  

 

If BumperAnimation is not rendering then

    Render BumperAnimation (assign SceneID = 1)

else if BumperAnimation (SceneID = 1) is rendering then

    Extend the duration of the BumperAnimation (using ModifyScene in this case) by x seconds

else if some other Animation is rendering (SceneID !=1)  then

    Add render of BumperAnimation to the UltraDMD queue so it eventually plays

End if

 

 

It's possible to to implement a queue outside of UltraDMD, but at this time I will just keep it simple and not worry about the queuing scenario,  Unless UltraDMD exposes the current SceneID that is running... :)



#267 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 27 August 2015 - 07:52 PM

In AMH, I actually have a specific DMDSceneQ routine for videos that definitely will be played either immediately if nothing else is rendering, or they get queued search for "VideoQ".  In the snippet I gave in the previous post, if you just remove the .CancelRendering call, then it will always queue the scene.

 

You could get fancy and do something like, scenes that you know you want queued, give them a priority of an even number and scenes you want to play only if they have a higher priority but get ignored if they have a lower priority than what's currently getting played, give them a priority of an odd number.  That way you can do a "if (priority MOD 2) = 0 Then queue the scene Else don't queue" call.

 

In my code snippet, you're coding your own scene ID essentially; you're using the priority number as both a priority indicator as well as a scene ID.  You can decide if you want to queue the animation based on the priority number, or just ignore it.



#268 lodger

lodger

    Board Certified Funk Master

  • Members
  • PipPipPipPip
  • 993 posts
  • Location:Altoona Pennsylvania

  • Flag: United States of America

  • Favorite Pinball: Whirlwind, TAF

Contributor

Posted 28 August 2015 - 03:26 PM

Shoopity,

 

I really like your prioritization method for gifs- this method would also work well for managing audio. One of the things that would likely be helpful is setting up a sub to trigger the animations ie triggeranimation 13, 250 to parse the number of an animation to a sub that would have a select case and to use the next as a priority value. it seems like code like this would generalize easily across tables and could be a pretty simple way for people to implement dmd.

 

This was a really valuable addition to people's strategies for ultradmd!

 

-Lodger


berzerk2_0logo.png

http://www.vpforums....&showfile=11819

Version 2.0- Released 2/27/16


#269 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 28 August 2015 - 06:10 PM

I played with HyperDMD a little way before I even started on AMH, and I sort of liked the scene builder for it, but it took a lot of wrapping my head around it.  Maybe it was because I've never worked with DMD stuff in real life, but it felt like using Blender for the first time; things just didn't work like I thought they should.  I started that approach with UDMD, and I was getting frustrated with the scene builder all over again, and then I realized you could just pass in the gifs directly from the script (as opposed to having to build a scene and then tell the DMD to run that scene).  I think with enough time and skill, you could do some amazing things with HyperDMD, but I felt it was easier to get some pretty good looking stuff with UDMD.  Plus, it seems HDMD is abandoned.

 

If you look more at my AMH code, I actually have a priority system for audio ;-).

 

I had to somewhat specialize the code for AMH since I was doing everything I could to keep the original code; so there I'm actually taking additional steps.  In AMH, Mr. Heck calls "video 'a', 'b', 'c', some video attributes, progress bar, priority", so I wrote my video sub to concatenate the letters into a single character, I'm currently ignoring the video attributes but at some point if I figure out how to do some good number placing I'll use this, and I switched the progress bar to be the number of frames in the animation.

 

Then in the DMDScene sub, I'm converting the number of frames to the correct pause time; PauseTime = (1000/FPS).  On my table I just rounded it to 60.   But if your gifs are running at 30 FPS, then you'd have a pause time of ~33.  This way you don't have to have calculate the pause time for every dmd call, you just pass in the number of frames (which many image viewing programs easily show you).

 

But if I were doing an original table, I'd skip the Video call and just go straight to DMDScene.

 

Maybe I'll right up a tutorial with everything I learned from working on AMH.



#270 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 28 August 2015 - 10:20 PM

Another suggestion (if this is still being actively developed of course):

Make the animation numbers make a little more sense

OR

Make the animation numbers user definable

 

As I understand it currently, the animation numbers range from 0~11 and 14, this is based on the script of the Test table.  But can we group them, or organize them differently?  One option would be:

Group animation types next to each other.  E.G. as is already the case with the first 4 numbers (although they seem to be broken), but keep that going so ScrollOnRight would be 4, and ScrollOffLeft would be 7, etc.

 

This would do two things: it would allow easy matching of animation.  E.G. Scrolling right would be 4 then 5, or Scrolling up would be 10 then 11.  It also groups types together, meaning all On animations are even, and all Off animations are odd.

 

I came across this because I wanted some random animations so I made X random and just passed in X for the animation types, but having an Off animation at the start or an On animation at the end is obviously bad.  If the animations were grouped differently, I could simply get a random X between 0 and 5, multiply by 2 to get an even number, then pass in X for the Animation In and X+1 for the Animation Out..  Not only that, but the animations would go together.



#271 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,370 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 29 August 2015 - 01:25 AM

Any idea why a GIF might not play at full speed? I don't see a setting in the scene builder for this, the GIF is 84 frames, is that just too big? It's about 3 seconds long, maybe 2.5 if it's 30fps, but I only see the first 10 frames or so and it runs real slow. All the other gifs I've made using the same method work just fine



#272 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 29 August 2015 - 04:15 AM

No, AMH has a few 180+ frames (like the attract animation).  Does the animation run at normal speed in other image viewers?  You say you only see the first 10 frames, is it cutting out sooner than your defined pause time, or is it paused the correct amount of time?  Can you post (or PM) a gif that runs fine and the gif you're having trouble with?



#273 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,370 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 29 August 2015 - 05:06 AM

no matter what I set the pause time to, it doesn't run the full gif, and it displays it really slow

 

here's the gif if you want to test it for me real quick

MpsOgBK.gif

 

what I see is just the initial sprite upward, at about quarter speed, and it just stops until the time runs out



#274 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 29 August 2015 - 11:11 PM

I'm not here to answer the how or why, but in GIMP, I didn't do anything to the graphic, I just resaved it as a gif, specifying the Delay between frames as 60 and checked the "Use delay entered above for all frames".  I'll say this, I noticed the first frame has a delay of 360 ms, so I don't know if UDMD just applies that to every frame or what.

 

You can either re-check your graphic and work it out yourself, or here's what I exported from GIMP.

futuramamine.gif

Attached File  futurama mine.gif   184.67KB   11 downloads


Edited by Shoopity, 29 August 2015 - 11:14 PM.


#275 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,370 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 30 August 2015 - 12:01 AM

So gimp can edit gifs? 



#276 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,370 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 30 August 2015 - 12:16 AM

Your gif worked great thank you

CYMX7kM.gif



#277 lodger

lodger

    Board Certified Funk Master

  • Members
  • PipPipPipPip
  • 993 posts
  • Location:Altoona Pennsylvania

  • Flag: United States of America

  • Favorite Pinball: Whirlwind, TAF

Contributor

Posted 30 August 2015 - 12:17 AM

I'm not here to answer the how or why, but in GIMP, I didn't do anything to the graphic, I just resaved it as a gif, specifying the Delay between frames as 60 and checked the "Use delay entered above for all frames".  I'll say this, I noticed the first frame has a delay of 360 ms, so I don't know if UDMD just applies that to every frame or what.

 

You can either re-check your graphic and work it out yourself, or here's what I exported from GIMP.

futuramamine.gif

attachicon.giffuturama mine.gif

Interesting- i had the same challenges when doing Gifs in photoshop only. i convert all my images in Gimp since Shoopity showed me and haven't had issues since then. Gimp seems to be super compatible with ultra dmd


berzerk2_0logo.png

http://www.vpforums....&showfile=11819

Version 2.0- Released 2/27/16


#278 freneticamnesic

freneticamnesic

    A Faint Ghost Through the Raindrops

  • VIP
  • 3,370 posts
  • Location:Portland, OR

  • Flag: United States of America

  • Favorite Pinball: Star Trek, Black Hole, AFM, Fast Draw, Tron, AMH

  • 360 Gamer Tag: sixgunsounddd

Posted 30 August 2015 - 12:25 AM

I shall try GIMP



#279 Shoopity

Shoopity

    Pinball Fan

  • Members
  • PipPipPipPip
  • 691 posts
  • Location:Colorado

  • Flag: United States of America

  • Favorite Pinball: Medieval Madness

Contributor

Posted 30 August 2015 - 01:02 AM

Each frame is broken out into a layer.  The name of the layer indicates the frame number, then in parenthases you can put the delay time for each frame, and you can define if it's a combined (meaning the lower layers/previous frame show through any alpha sections; this usually saves on space except for GIFS like the this Futurama opening since every frame has a difference.  But if there's minimal movement in a picture, the combine method has the potential to greatly reduce size), or replace (every frame/layer replaces the previous one) frame.


Edited by Shoopity, 30 August 2015 - 01:04 AM.


#280 John90803

John90803

    Enthusiast

  • Members
  • PipPipPip
  • 56 posts
  • Location:Chicago

  • Flag: United States of America

  • Favorite Pinball: Monster Bash

Posted 30 August 2015 - 07:05 PM

Hey guys, I'm having installation problems on Win7. I created a folder called XDMD and downloaded the files from the website and dumped them all in there along with UltraDMD.exe 

The only folder I I found all the required .DLL's in was XDMD demo\bin\debug - so i put the UltraDMD.exe in there. I then ran the command prompt function and did the UltraDMD.exe / i comand and a dialog box opens and immediately closes. I tried running the .exe from windows explorer and it just says "the program has stopped working" and crashes. I can't get it to do anything. Im not sure what I'm missing. I just wanted to get AMH up and running for my daughter. 

Thanks for your help.