Jump to content



Photo
- - - - -

DMD system made simple


  • Please log in to reply
23 replies to this topic

#1 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 07 April 2010 - 02:46 AM

Hi guys

Well, I've ALMOST finished with Wallace and Gromit and after the Spiderman DMD i had a few people interested in implementing the DMD system into their tables. However, I think it's fair to say everyone who looked at it found themselves a little swamped by the code. I realise now that I was pushing the limits of what the system could do, rather than just giving a table author what they want - a DMD system that would, for the time being, just work a bit like a text box and display scores etc.

So I made this little tech demo. This has all the code of the full system for running animations etc, but you can ignore all that for now! for people who might like to try implementing it into a table, I've demonstrated here the very simple way you can use it. In this system you only have three commands you need to learn to make it work:

DMDINIT:

e.g

DMDInit(0)
DMDInit(1) - these should be run at the start when the table starts to initialise the DMD.


DMDPRINT:

e.g

DMDPRINT 0,0,"TEXT" - print TEXT to the big letters of the DMD
DMDPRINT 1,0,"TEXT" - print TEXT to the small, lower section of the DMD

remember to use capitals only or you will get an error!


DMDSCORE:

DMDScore - print the score and current ball to the DMD (using variables Score and Balls as your way of tracking this)

So basically it works just like a text box, only it is full colour.

To implement it into your own table, you would have to:

- copy all the reels over and make sure they are name EMreel1 to Emreel30, with EMreel1 to Emreel10 being the big ones, and 11 to 30 being the small ones
- copy the four timers and make sure they are called DMDtimer1, DMDeffecttimer1,DMDtimer2 and DMDeffecttimer2
- import the reel images (or make your own) one is included which is very basic.
- copy the script (it's marked where you should copy from in the table sample)

and that's it!

So here is all is in a zip. As you can see, it is very small in size so does not result in a huge table download! If you would like to try it out, I hope you enjoy it, and if you'd like to know more, then just ask, I'm happy to help. It would be nice to see people give it a go. Once you get the idea of simple printing, I'd be happy to explain how to do animated text which is not too hard a jump.

Attached Files

  • Attached File  dmd2.zip   86.68KB   65 downloads


#2 The Hermit

The Hermit

    Hobbyist

  • Platinum Supporter
  • 45 posts

  • Flag: United Kingdom

  • Favorite Pinball: .

Posted 07 April 2010 - 03:31 PM

Many thanks! dblthumb.gif
That will certainly save me a LOT of time should I decide to use a DMD for anything in future. Worship.gif

#3 jpsalas

jpsalas

    Grand Schtroumpf

  • VIP
  • 7,328 posts
  • Location:I'm Spanish, but I live in Oslo (Norway)

  • Flag: Norway

  • Favorite Pinball: I like both new and old, but I guess I prefer modern tables with some rules and goals to achieve.



Posted 08 April 2010 - 01:38 AM

Nice one highrise. Now, could you just explain a little how to use the effects? cool.gif

If you want to check my latest uploads then click on the image below:

 

vp.jpg

 

Next table? A tribute table to Stern's Foo Fighters


#4 wtiger

wtiger

    Pinball Fan

  • VIP
  • 1,148 posts
  • Location:Los Angeles, CA

  • Flag: United States of America

  • Favorite Pinball: Junkyard



Contributor

Posted 08 April 2010 - 02:24 AM

Thank you highrise!

#5 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 08 April 2010 - 09:19 PM

smile.gif

well, if someone decides they want to use it in a table then I'll happily explain further!

#6 The Hermit

The Hermit

    Hobbyist

  • Platinum Supporter
  • 45 posts

  • Flag: United Kingdom

  • Favorite Pinball: .

Posted 09 April 2010 - 02:30 PM

QUOTE (highrise @ Apr 8 2010, 10:19 PM) <{POST_SNAPBACK}>
smile.gif

well, if someone decides they want to use it in a table then I'll happily explain further!



Sounds like a potential catch-22 situation: Authors will want to use it, but don't want to be the only one to ask, and you see not point in giving instructions if no-one will use them! laugh.gif

Ok... I'l bite then. I've looked through the code and seen the options, but it would be good to have your instructions rather than having to work it out when I do try to use it. So go on, PLEASE tell us!!!

love39.gif

#7 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 10 April 2010 - 01:55 PM

ahhhh.... ok

Well, here are some explanations. Firstly, forget about animations for now. Yes, I know that is what everyone wants, but you know, you have to walk before you can run. Let's look at how we can print not just letters, but also graphics to the DMD.

A simple way of thinking of how the DMD works is to think of it as a set of tiles. The 'contact sheets' that the DMD uses (the image files with all the letters and numbers on them) is made up of 200 of these tiles. You can see them if you look at the image, tiles01, or the spidermandmdnew image, both of which I have attached, which is used for Wallace and Gromit and Spiderman DMD respectively. What you will see is that the first 50 tiles or so are used for the main letters and numbers. Basically, they are like scrabble pieces which allow you to make words. The next 10 are used to allow the DMD to put commas under the numbers. So these first sixty are 'reserved'. You then have another 140 can be anything you want them to be.

The main DMD section, the big top half, is ten tiles across. This means you can print a score of up 9,999,999,999, or a ten letter word or pattern made up of whatever tiles you define.

Now, if you have 200 tiles, it's difficult to come up with a command which allows you to print any of them in a simple way. So I decided to split the system into four character sets of 50 tiles each. Character set zero is the numbers and letter, and character sets 1,2 and 3 are for everything else. Have a look at the next image attached, tiles02. Here you can see how the 200 tiles are split into four groups of 50 so they can be easily called upon.

So, if I send an instruction like this:

DMDprint 0,0,"HELLO";

I am saying PRINT to DMD 0 (the top one), using character set 0 (numbers and letters), the text "HELLO"

Now look at the image tiles03. See how the letters are overlaid? this tells me how I can print graphics. See the image of Wallace eating cheese, which is four rows down? you can see that this image constitutes letters 'OPQ' in character set 1, the second set down.

So if I want to print the image of wallace eating cheese, I would use the command

DMDprint 0,1,"OPQ"

which says PRINT to DMD 0, usiing character set 1, the letters "OPQ"

But because I have redefined character set 1 as graphics, it will print this instead of the letters.

I guess you can then see from that in character set 1, the letters 'R' and 'S' are used for Wallace in a slightly different position. So if I were to use this command:

DMDprint 0,1,"RSQ"

It will takes tiles R,S and Q from set 1, which combine to make wallace with the cheese closer to his mouth. Alternate between them and you have animation.


Similarly, if I print letters T,U,V,W,X and Y in that order you will see the spaceship taking off.


Does that make sense?? I hope so! I think that is probably enough to begin with... any questions, just ask.

Attached Files



#8 Shockman

Shockman

    Pinball Fan

  • VIP
  • 1,717 posts
  • Location:Portland Or.

  • Flag: United States of America

  • Favorite Pinball: Star Trek

Posted 10 April 2010 - 05:08 PM

QUOTE (Shockman @ Apr 10 2010, 12:06 PM) <{POST_SNAPBACK}>
It's genius in action.

Is it fast?

What would be cool is if you could use a program like Game Maker (or something like it) and have a room for each display instance.
That way to create the DMD would be drag and drop.
The character sheet could be used as either a bitmap font or sprites. If sprites you could use the built in (nicely functional) sprite editor to edit or create. And The room can be set up to any grid to match and even have snap to grid.
Then have GM dump raw data (that function would have to be scripted)
Then as far as VP goes it would just be a matter of reading that data and converting it back to images.

I don't know how easy it would be on either end. But even if the conversion was not possible in GM, or too complex in either program, you could rewrite the graphics portion of it to one reel, with one entire image for the graphics portion, and still store and display animations. And still have the text writing functions separately. Then manually capture the rooms as screenshots.

I could check on the GM forum to see if the converting of the room, by way of a sprite index at any given room grid coord. would be possible. The grid is there, the sprite index is built into the sprites, and it might even handle the animations for you, but you would have to have a single reel probably for the graphic portion of of your DMD.

Features you would have automatically if it was set up like this is;
Animation;
Jump to point, and this can be relative to the last point.
Rotation.
Flipping.
Scaling.
those kinds of things.

Also game maker with a single command will dump a snapshot of the Room as an image every time you ask it to.

I'm not saying it would be easy to set this up. I'm just saying it's possible, one way or another, and that once it was set up that creation of DMD animation creation would be a piece of cake.

If I was going to do something like this in GM, and I might indeed, I would just have a two sprites, for a two color display, 4 for a four color display, etc. The sprite limit as well as room number limit is not set. It would only depend on the computer memory, so limitless for an app. like this.

A more complex but even better way would be to write an app. in say game maker that is basically a DMD and click dots on and off. and create an .EXE of it. Probably just a days work to have the editing part built.
------------------------------------------------------------------------------------------------

What is the limit on the number of images a reel can have in VP9?
Does reel stacking work in VP9 or not?
Are reels fast enough to keep a DMD size single reel running in VP9?
Are reels scalable at all, or does the image have to match size perfectly in VP9?
Is there still the multiple of 8 rule in VP9?

I doubt it, but the answer to all the questions above were yes, then I could have a point and click DMD maker made in a week, one that creates, edits, and stores reel images. At which point development would continue in areas such as sound events built in, .PNG import which would have be the background and a black mask foreground with transparent dots.

My Sub game is almost done, so I will look into something like this next. It would not be to replace your system, the separate image and text areas are a great idea, and you already have a printing function (does that use transparent background? not that it need to) but if it could be written to be such, then it could share space with the graphics portion.

If I get it done, you can have it if you want. It should be possible to use a number of reels to match yours, or if you don't, then I will just add your text functions to my system.

I'll have to do a feasibility study first, I'll let you know how that goes soon.

Usually I can imagine and predict the roadblocks, but I'm drawing a blank on this.


Edit:
I think you just saw an idea turn into a project.

Also, what is the dot matrix (dot count) on a typical DMD?

#9 Bob5453

Bob5453

    I'm taking a nap

  • VIP
  • 3,896 posts
  • Location:Near Dayton, Ohio USA

  • Flag: United States of America

  • Favorite Pinball: Any table I can play while sitting in a rocking chair




  • Trophies:

Posted 10 April 2010 - 06:30 PM

Full Screen is the way to play VP now, IMO. If we could only move a reel to a second monitor or easily rotate a reel in VP, I would be more inclined to be excited. Do you still have to do your reel animations when the ball is inactive to prevent stuttering or jerkiness? How can it be made simple when you have spent months working on a display for Wallace and Gromit?

I think VP lights are the way to go on a project such as this. I want to just be able to plug the text into the script and then add a script line for each special effect and then have it work right out of the box. I don't want to spend more time working on visual effects for a score display than I did creating the table.

Anyway, I'm not knocking your system, I'm just explaining why I'm not really interested in it at this time.

Posted Image

You have discovered an Easter egg. Pat yourself on the back.


#10 The Hermit

The Hermit

    Hobbyist

  • Platinum Supporter
  • 45 posts

  • Flag: United Kingdom

  • Favorite Pinball: .

Posted 10 April 2010 - 07:05 PM

QUOTE (highrise @ Apr 10 2010, 02:55 PM) <{POST_SNAPBACK}>
[SNIP!]
Does that make sense?? I hope so! I think that is probably enough to begin with... any questions, just ask.


Perfect sense. Alternate character sets are the exact way I used to do animated graphics on my C= Vic-20 years ago!

Thanks! dblthumb.gif

Bob I think the ideal solution would be for DMD functions to be added to VP now it's Open Source... wink.gif but until that happens ANY solution that is simpler than using 100's of reels or lights is to be welcomed.

Edited by The Hermit, 10 April 2010 - 07:10 PM.


#11 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 10 April 2010 - 08:06 PM

hi guys

It didn't take months to do Wallace and Gromit! I just have lots of stuff going on in real life is all.

As for it running during play, this new system now works perfectly without any concerns there - this is because it uses 30 reels instead of 300. You can run the animations any time you like, even in multiball.

Printing scores, as I have shown you, is just a question running the command 'dmdscore'.

As for what it can achieve with application, well you can download this Beta and take a look if you want:

http://www.plummusic...it_VP9dmd05.zip

and lastly, it CAN be put onto a second monitor I believe. this is the earlier version of the DMD system I wrote for the Spiderman table:

http://www.youtube.com/v/dCaBEg_a0tg

I promise you that's not a fake, that's my system in use smile.gif




#12 Shockman

Shockman

    Pinball Fan

  • VIP
  • 1,717 posts
  • Location:Portland Or.

  • Flag: United States of America

  • Favorite Pinball: Star Trek

Posted 11 April 2010 - 12:33 AM

That's incredible highrise. It looks like a real a real DMD.

Even if it did take you months I think it was worth it. I would be very proud of myself to have built that.




#13 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 11 April 2010 - 05:58 PM

Thanks man. It's a culmination of lots of work I have done with DMD 'simulators' in the past. This is the first one I've done which is quick enough to run within VP and still work with the ball in play - using lights or many more reels just makes it run really slowly.

regarding the graphics, I use a photoshop template which has four layers, this allows you to convert standard images into one which look correct on a DMD if anyone is interested.


QUOTE (Shockman @ Apr 11 2010, 01:33 AM) <{POST_SNAPBACK}>
That's incredible highrise. It looks like a real a real DMD.

Even if it did take you months I think it was worth it. I would be very proud of myself to have built that.



#14 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 12 April 2010 - 10:24 AM

hey guys

Here is the photoshop document that I use to create the DMD graphics. It uses five layers which create the overall effect. All you have to do to make the images looks right is put greyscale images in the middle of the layers, so you don't need to any fancy importing or exporting. Then you set their layer mode to 'screen'. It's also usually a good idea to increase contrast and use effects like 'poster edges' on the images before you put them in, it makes them look better.

Attached Files

  • Attached File  dmd1.zip   25.63KB   13 downloads


#15 rascal

rascal

    two-faced as they come

  • VIP
  • 1,374 posts
  • Location:Indiana USA

  • Flag: United States of America

  • Favorite Pinball: Bally Eight Ball



Posted 12 April 2010 - 10:32 AM

Very nice work HR, you are the DMD master! cool.gif

Posted Image


#16 Harakiri

Harakiri

    Highscore Engineer

  • Members
  • PipPipPip
  • 409 posts
  • Location:Portugal

  • Flag: Portugal

  • Favorite Pinball: LOTR (yeah seriously)

Posted 12 April 2010 - 12:17 PM

Hello!

I got very interested about learning more on how to design DMD animations and when i tried to render the template you designed i got the following error:



#17 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 12 April 2010 - 01:33 PM

hey Harakiri

Unfortunately this is due to how VP sometimes loads in scripts. It's easily fixed though, there are missing carriage returns, The 'end sub' commands should be on their own line.

it should say :

Sub Table1_Init()

DMDInit(0)
DMDInit(1)


DMDprint 0,0," HELLO "
DMDprint 1,0,"AND WELCOME!!!"


End Sub

Sub Bumper1_Hit() score=score+100
DMDScore

End Sub


Sub Bumper2_Hit()
score=score+100
DMDScore
End Sub

#18 highrise

highrise

    Pinball Fan

  • VIP
  • 589 posts

  • Flag: ---------

  • Favorite Pinball: Scared Stiff



Posted 12 April 2010 - 02:19 PM

so guys, I was thinking about what Bob said, about how it didn't seem like it would work out of the box easily, or at least take a long time to implement, so I figured I'd try something out. I've worked with Bob before so I know he won't mind me tinkering with one of his tables as long as I don't release it without his say so, so I thought I'd see how easily the system could be worked into his Mars Attacks table.

15 minutes work and as you can see from the screenshot it is displaying the score and number of balls quite happily. Animations could be added relatively easily as well if I was so minded...

Bob has added lots of great sounds to this table so it would be fun to do. So if Bob is fine with it and I have a handful of people interested, I would be happy to start a short community project in which we add the DMD to this table including a few animations, so you can see it is not so tricky to do!

Attached Files

  • Attached File  mars.jpg   148.44KB   38 downloads


#19 Bob5453

Bob5453

    I'm taking a nap

  • VIP
  • 3,896 posts
  • Location:Near Dayton, Ohio USA

  • Flag: United States of America

  • Favorite Pinball: Any table I can play while sitting in a rocking chair




  • Trophies:

Posted 12 April 2010 - 03:37 PM

QUOTE (highrise @ Apr 12 2010, 10:19 AM) <{POST_SNAPBACK}>
So if Bob is fine with it ....
I would rather not have the DMD in Mars Attacks as I want to maintain complete control over it. Maybe use Wallace & Gromit or Spider-man or better yet, just a simple demo table.

I'm only interested in being able to move a scoring system to another monitor for Full Screen tables, not spanned tables. I only play FS tables at the moment, I will probably only release FS tables in the future. I have a FS Mars Attacks table, if you can get your system to display on a second monitor, that's when I will be interested. The main screen turned vertically with nothing but the table on it and the second monitor as a backglass with scores, that is the future of VP.

Posted Image

You have discovered an Easter egg. Pat yourself on the back.


#20 The Hermit

The Hermit

    Hobbyist

  • Platinum Supporter
  • 45 posts

  • Flag: United Kingdom

  • Favorite Pinball: .

Posted 12 April 2010 - 04:08 PM

I've gone through the script and realigned the indents so it's easier to work out what is within If...Then, Select...Case, For...Next, Subs, Functions, etc.

Is it ok to upload it Highrise?