PDA

View Full Version : Limiting credits in MAME?



dmworking247
18th May 2007, 07:10 PM
Alright, time to put the thinking cap on...

I still havent installed a coin mech in my otherwise complete cab. I was finally about to do it this weekend... but...

The purpose of putting in coin mechs is for authenticity, but I had also hoped that it would stop the kids from putting in unlimited credits as they tend to do with the Mame shortcuts. The problem is, with 20c coin mechs its not like we have a houseful of them and I dont want to limit the amount of games they can play when their friends come over... which will inevitably lead to an 'open door' with the same 20c pieces cyling over and over (again: unlimited credits).

So... I was thinking of putting two of the credit buttons (like the ones ozstick is selling) in my little 'admin panel' below the keyboard drawer and above the coin door. Here's the tricky question though:

Can anyone think of any software or hardware ways to limit the amount of credit pulses that can be sent in a row either for a set period of time or some other condition. Preferably the maximum amount of credits could be adjusted too. Hardware wise I imagine it would require some sort of circuit that allows 5 pulses but has to be somehow 'reset' to allow anymore.

I may still install a coin mech for novelty value, but since it may not be the primary credit mechanism... I was thinking of getting a coin mech that takes american quarters... has anybody seen them for sale in Aus?

@lien_Zed
18th May 2007, 07:39 PM
i have a single 20c comapritor wired to my mame cab. i wired it to both player one and player 2 credits on the ipac.
in a lot of games a single 20c coin registers 2xcredits, one for each player.
i took a 10 dollar note in to a bank and asked for it to be changed in to 20 cent pieces. i recycle the 20 cent pieces. trust me, the kids play a ton of games before i open the cabinet again to recycle the coins. the kids even sometimes put a few extra 20 cent coins in that they find at the school yard or from their pocket money

dmworking247
18th May 2007, 07:42 PM
Yeah that was my original idea... but having a $10 pile of 20c pieces next to the cabinet really isnt much different to letting them add as many as they like.

Other than just telling them off repeatedly, I'd like to somehow limit the credits per game so that they're forced to do it the right way... if they're not actually losing money by playing bad then they dont try as hard...

IMPURE
18th May 2007, 07:48 PM
give them 5 coins each a day, keep the door locked, once there gone there gone, hide the bag of 20 cent pieces and if friends come over bring the bag out lol easy fixed..

AdamC
18th May 2007, 07:53 PM
Heres my coin mech , credit buttons
http://i161.photobucket.com/albums/t237/adamndeb/DSCN0849s.jpg
I use the electronic coin mech that is found at ozstick , well it was , but they have discontinued it.

All you have to do is insert whatever coin u want to be as the "credit" inside it , and it will give u credits upon that shape coin.

OzStick
18th May 2007, 07:55 PM
Hmmmm, what to do?

It's difficult, because in a way you are contradicting yourself - you don't want to limit their credits but you don't want it to be unlimited!

You could always put a toggle switch inside the cab that "turns on" a credit button, that way when friends come around you switch it to "free play" so they don't have to drop a coin in the slot. When their friends leave you open up the cab and flick the switch back off.

A simple SPST switch from the local electronics shop would do it and just wire it up in line with the ground wire for the Coin button.

Cheers,
Chris

elvis
18th May 2007, 07:57 PM
I may still install a coin mech for novelty value, but since it may not be the primary credit mechanism... I was thinking of getting a coin mech that takes american quarters... has anybody seen them for sale in Aus?

Check both Excellentcom and the BYOAC forums. Both are good sources for custom arcade tokens.

OzStick
18th May 2007, 07:59 PM
Heres my coin mech , credit buttons
.........
I use the electronic coin mech that is found at ozstick , well it was , but they have discontinued it.

All you have to do is insert whatever coin u want to be as the "credit" inside it , and it will give u credits upon that shape coin.

Hey Adam, are you happy with your Coin Buttons??

Cheers,
Chris



I may still install a coin mech for novelty value, but since it may not be the primary credit mechanism... I was thinking of getting a coin mech that takes american quarters... has anybody seen them for sale in Aus?

Just buy one of my $25 jobbies - the CM03. They are easily adjusted to take any coin, as long as it is round!

Cheers,
Chris

AdamC
18th May 2007, 08:07 PM
They look great !!!! :)

dmworking247
18th May 2007, 08:11 PM
Hmmmm, what to do?

It's difficult, because in a way you are contradicting yourself - you don't want to limit their credits but you don't want it to be unlimited!


Cheers,
Chris

Thats not quite what I meant... I mean I want them and their friends to be able to play/try as many games as they like, as many times as they like... but not keep credit feeding the same 'turn' at a game.

Eg... play bubble bobble, maximum 5(?) credits ($1) between them. If they exit and enter another game... they can put a max of 5 credits to that.

OzStick
18th May 2007, 08:18 PM
Thats not quite what I meant... I mean I want them and their friends to be able to play/try as many games as they like, as many times as they like... but not keep credit feeding the same 'turn' at a game.

Eg... play bubble bobble, maximum 5(?) credits ($1) between them. If they exit and enter another game... they can put a max of 5 credits to that.

OK, I get it now. Can't think of anything and I suspect it may be outside the scope of the MAME project. I could be wrong of course!

@lien_Zed
19th May 2007, 07:50 AM
Yeah that was my original idea... but having a $10 pile of 20c pieces next to the cabinet really isnt much different to letting them add as many as they like.

the coins are not next to the cabinet, they are in the cabinet in the tupperware coin box i pinched from my wife's collection of tupperware....

at the end of the day, who really gives a toss how many coins they feed thru it, the cabinet and games are there for *FUN*

my kids have their friends sleep over here almost every weekend now since i got my lowboy running and shoved it in the lounge room....

this is what makes memories for kids when they get older...
i wish when i was their age i could recycle my coins thru pac-man and gyruss and zaxxon...

let kids, be kids

find another project to work on...

heres a few suggestions, a digital pinball machine - they use monitors instaed of a play field, put an xbox/ps2 in a cabinet with 5.1 speakers for the kids to play, build a racing car cabinet and shove daytona on it... i have an original copy of it for win 98 i can "loan" you

better yet, when they are playing, if your cab has 2 players, then why not verse them in a game... my kids and i verse each other all the time in damn near anything, great fun:)

comrade.vader
19th May 2007, 07:55 AM
:lolwhy not just emulate the coins, everything else is

@lien_Zed
19th May 2007, 07:55 AM
Thats not quite what I meant... I mean I want them and their friends to be able to play/try as many games as they like, as many times as they like... but not keep credit feeding the same 'turn' at a game.

Eg... play bubble bobble, maximum 5(?) credits ($1) between them. If they exit and enter another game... they can put a max of 5 credits to that.

there was a program written by headkaze that could be easily modified to do this.

the program that headkaze wrote allowed you to feed coins in and switch games and keep the credits you had...

it was posted at the gameex forums, but lots of people had a cry about it and said it was pushing the limits of it and could be used in commercial purposes and bassicly took a great idea and killed it... pricks.... oh well, nothing new there i guess, seems to be the way society is going now days...makes me sad to see such great ideas killed off

i have no doubt headkaze could modify his program to suit this need.
be great if both versions of the program could be released here in the forums and without headkaze name in the programs that way if they do get to the "outside world" there is no repercussions on headkaze

@lien_Zed
19th May 2007, 08:22 AM
heres the thread about the s/w by headkaze at gameex forums

http://www.gameex.info/forums/index.php?showtopic=2273&hl=

another link

http://www.1emulation.com/forums/index.php?showtopic=17392

CRAZED
19th May 2007, 09:19 AM
I dont get it! Are you trying to give them the same experience you and i had?
If you are i think the best way is hide the coin bag or the switch idea, otherwise they are still getting unlimited credits. The only thing you will achieve is limiting the game length, they will know they can just exit the game and re-enter to get another 5 credits!

I say limit them to the amount you were givin so they can experience what it is to play, not just hit the buttons... :tomato

rash
19th May 2007, 09:55 AM
I may still install a coin mech for novelty value, but since it may not be the primary credit mechanism... I was thinking of getting a coin mech that takes american quarters... has anybody seen them for sale in Aus?

I am not sure but highway entertainment had some quarter coin mechs on their stock list but the web site is down at the moment.Saw somthing about quarters on there the other day .mabey try this later..


http://www.highway.net.au/stocklist.html

Potato King
19th May 2007, 12:45 PM
I say limit them to the amount you were givin so they can experience what it is to play, not just hit the buttons... :tomato

Totally agree! I think what added to the excitement of me feeding the machine in my youth was my credit was valuable, I could have used my 20c - 40c to buy a big f*%k off bag of mixed lollies but I was sacrificing for the chance to play an arcade game & make it last as long as possible, if I died it was a waste.

You should attempt to make that 20c damm valuable to them & not just a token that sits next to Dads' Mame machine, I agree with a few others here that give their kids their pocket money with 20c pieces included. That is the only way you will give them the same experience we did.

Having said that thou when I was about 13 the arcade called "The Wall" closed down in Kalgoorlie & my best mate's Uncle was given Rygar & Super hang-on to look after, basically these were next to brand new games & we had unlimited credits. I remember they were some of the best school hols ever. So if their mate's come around for a sleep over Im sure you could lax the rules a bit.

I know where you’re coming from thou DM, it would absolutely do my head in watching them clock Bubble Bobble with 300 credits being one of those games that you will eventually get through given the time & money. Well done for giving it so much thought thou, excellent thread mate.:)

CRAZED
19th May 2007, 01:43 PM
Having said that thou when I was about 13 the arcade called "The Wall" closed down in Kalgoorlie & my best mate's Uncle was given Rygar & Super hang-on to look after, basically these were next to brand new games & we had unlimited credits. I remember they were some of the best school hols ever. So if their mate's come around for a sleep over Im sure you could lax the rules a bit.

Once your hooked on playing legit, its ok to get unlimited games now and again.
For me i started with the local video shop after school and whenever else i could. Then Timezone introduced the Super Session and Powerplay did also, it was 2 hours unlimited for $10 dollars on saturdays between 10-12am
That didnt ruin my respect for 60c Streetfighter 2 games during the week, i still played.
...and any way look at us we dont charge ourselves to play well at least i dont, perhaps i should maybe id save a little extra cash....

Basically There has to be a balance if there to have the same passion for the hobby as us, now who would wish that on anyone:lol

Finno
19th May 2007, 09:54 PM
Essentially what you would need is a program to intercept keys before they get to mame. When a credit is entered (key 5) it increments a counter and then passes the key command to mame only if the counter is still below a set threshold. If the esc key is pressed (to exit a game) the counter gets reset.

It seems somewhat trivial but it would need to execute pretty quickly because it would be a middleman and you don't want it to interfere with game play when passing key presses for the joystick and buttons.

I'll do some searching and see how tricky it looks.

dmworking247
21st May 2007, 11:05 PM
Essentially what you would need is a program to intercept keys before they get to mame. When a credit is entered (key 5) it increments a counter and then passes the key command to mame only if the counter is still below a set threshold. If the esc key is pressed (to exit a game) the counter gets reset.

I'll do some searching and see how tricky it looks.

Good thinking '99... Some little util that limits the amount of keypresses on a specified key (eg #5 & #6) until a 'release' key is pressed (ESC as you say). This would make a user have to exit to the front end and re-enter the game to get more credits... but it would definately achieve the desired result.

I think I wouldnt be the only person who would like to give their friends/kids unlimited credits but still limit the amount of 'continues' or 'freebies' they can use per game.

In the mean time... guess who got off their lazy ass today and finished restoring the coin mechs!

http://www.got2getalife.com/arcade/webshots/s_chairs02.jpg

Mr_Staypuft
22nd May 2007, 12:23 PM
I think that you'd need to build a hardware device to do this,
otherwise I suspect you'd need to do your own "custom" mame build to make it work?

The hardware would have a little bank of dipswitches (to set max credits/game)
and some simple logic/counter stuff.

================================================== =======
(credit input) ===> if output is enabled, then output "credit" & increment counter
if (dip switch) = (counter) then disable output
if (escape) then reset counter, enable output
================================================== =======

Anyone here good with designing basic circuits, soldering, chips?

adn0r
22nd May 2007, 06:56 PM
If you're using windows, this is easily done using an autohotkey script. www.autohotkey.com Easily one of the best simple scripting tools to get things done in windows. I use it on my cab with a script that requires you to hold down ESC for 2 seconds to quit a game, to prevent accidental shutdowns

Here's what I just whipped up, this will allow you to pres 5 and 6 up to 5 times each, then will no longer accept those keys until the esc key is pressed. U[on pressing esc the counters are reset and both credit buttons can be pressed another 5 times. Of course this could be expanded upon furthur, eg only operate when MAME is the active window, disable the script when pressing 5/6 in your frontend, etc. Its not a very complicated language and there is plenty of documentation and examples on their site.


key5 := 0
key6 := 0

~esc::
key5 := 0
key6 := 0
return

$5::
key5++
if key5 <= 5
{
send, 5
}
return

$6::
key6++
if key6 <= 5
{
send, 6
}
return

I'll attach a compiled exe of this script. :)

Finno
22nd May 2007, 09:52 PM
That's awesome and so easy. Open Source too!

I checked out the website and couldn't find any mention of which Windows versions were supported. I know DM is using 98.

So you obviously don't notice any interference with your normal game playing key response?

dmworking247
2nd July 2008, 09:33 PM
I thought I'd bump this (over a year old) thread.

This credit lock utility is great, I got over the novelty of putting in 20c coins for my little kids who like to play the arcade all day, so I installed a suplimental credit button... but every time they die they feverishly press it with no concept of how much 'money' they're spending.

So to incent them to work harder, I dug up this old gem... it allows them to add a maximum of 5 credits and then no more credits will be accepted unless they press escape (aka quit the game). They can then re-load the game or play another game and have 5 credits again.

Great incentive to try harder and get better I reckon!

The only thing that would be better is if you could use a configuration file to set the 'max credits' amount without having to change the code and re-compile. Anybody want to have a crack at improving the code?

@lien_Zed
3rd July 2008, 07:57 AM
Other than just telling them off repeatedly, I'd like to somehow limit the credits per game so that they're forced to do it the right way... if they're not actually losing money by playing bad then they dont try as hard...



maybe your taking game playing a litte too seriously.

remember, games are there for fun.

man, being a kid is all about making memories.
who care who many coins they feed in, let them have fun.

MetalSkin
3rd July 2008, 08:24 AM
I thought I'd bump this (over a year old) thread.

Thanks for the :bump: I'd have never found this otherwise! very very very nice.


The only thing that would be better is if you could use a configuration file to set the 'max credits' amount without having to change the code and re-compile. Anybody want to have a crack at improving the code?

I'll have a look at it. A little busy on some other stuff, so may be a little bit before I do it, but this should be easy to do. Personally I would rather do this in C++ or something. C# is a tad more accessible right now, but I doubt it that will help people on win98.


maybe your taking game playing a litte too seriously.

remember, games are there for fun.

man, being a kid is all about making memories.
who care who many coins they feed in, let them have fun.

Hmm I havta disagree with that mate. I've got three boys and what I have found is that all they wanna do is surf the net to find the cheats so they can finish their game that they have. Often they will try until they get to a bit that they don't know how to get past, their reaction is to either ask me to get em past it or to find cheat codes so they can cheat past the hard bit. :(

And once they finish it they don't wanna play it any more. :(

I gotta wonder what's the bloody challenge in beating a game via cheats? I think it's more a case of they wanna see what the game does, than beat it. Also makes buying them games for the PS2 or Xbox 360 bloody exy as they just don't last. :cry

The only exception would be games like some of the racing ones where you rack up points and can upgrade cars. But knowing my eldest I reckon he would cheat if it got him a better car quicker! :o

Personally I think this is a great idea and I would be setting the limit to 2 coins.

But of course it does depend on the individuals involved. However I've noticed something easily gained loses it's value, as there is no appreciation of it's value.

:D

dmworking247
3rd July 2008, 09:36 AM
Here here! As a kid I'm sure we would have loved unlimited credits but I bet the novelty of arcades would have worn off fast if that were the case, and we wouldn't be very good at games.

Thats why I want my kids to learn to try harder. I'm not limiting their time on the arcade - they are... get better and your turn goes longer :)

PS Metal Skin, I'm running WinXP now anyway.

munkychump
26th July 2008, 09:36 AM
Thanks for bringing up this old thread!

It is exactly what I was trying to do and asking about over at arcadecontrols.com in this thread (http://forum.arcadecontrols.com/index.php?topic=79646.0).

I'm so glad someone's found a simple solution! It's exactly what I'm looking for, although I always wanted to have the option for allowing a few different limits... I was thinking of going the 4017 decade counter route as mentioned in the above thread using a 3 position switch to swap between allowing 5, 10 and 20 credits (or whatever combination you want from 1 - 20).

It wouldn't be too hard to make a simple circuit that uses a couple of 4017's to get your count of 20 and a 555 timer... but it's beyond my electronic abilities.

If anyone has the ability to make this circuit I would be extremely indebted!

AskJacob
26th July 2008, 11:38 AM
A trivial circuit as you said... are you not OK with the sofwtare solution though?

I'm a bit lazy and would be tempted to use a small microcontroller as these days they cost the same as a couplle of 40XX chips...

When I was thinking about this My 1st thought was something like a Neo Geo credit board kind of hardware device, configurable like you mentioned, but with the bonus of a 7-segment LED credit display (as an option).

IS there really any demand for a hardware version? If so, I can knock one together if someone wants to try it out.

MetalSkin
26th July 2008, 01:55 PM
IS there really any demand for a hardware version? If so, I can knock one together if someone wants to try it out.

I don't mind the hardware solution, may make it easier to work with non mame cabs! Actually I like both solutions, specially if the hardware solution could be addressed by the software to set the limits! so you could change the configuration automatically based on which game it is!

If you do hardware I would be interested in how you do it as it's something I'm wanting do get into.

biggeorge
27th July 2008, 04:43 PM
The way I see it there's 2 way to maintain "control" with hardware:

1. The cheap way - Install a magnetic reed switch somewhere in the cabinet. Then either use a magnet (which the kids would figure out pretty quick) or make up a little electromagnet button wand thing to trigger it. They never see the inside of the cabinet, they never know how your magic wand works. A degaussing wand would be great, but expensive.

2. The less cheap way - Install a remote keyfob controlled central locking kit, they run off 12v and simply switch to ground. If your worried about stuffing up the wiring or the ipac, use an automotive relay on the central locking kit's output to trigger the 5/coin button on the ipac straight to the ipac earth.

When kids behave, you hit the button on the keyfob from anywhere in the house and kaplink, credits appear.

Method 1 would cost $10 to $60 depending on complexity.
Method 2 would cost $40-$80.

Jaycar also sell a barrel lock with a momentary switch built in for about 8 bucks. That'd do the job too.

I can relate to the thrill of losing something for bad playing, however the thrill of owning the machine or having it at home is that you don't have to feed the bugger money to enjoy it.

Thrill #2 is a happy place.

Thrill #3 is owning a cabinet, not having to feed it coins and being able to cheat your ass off and get further into a game than ever before, finish it, or simply just see the ending screen.

But #3 really ruined it for me. Just be happy if they never discover #3 and are happy at #2.

gambaman
23rd February 2018, 02:58 AM
I had also hoped that it would stop the kids from putting in unlimited credits as they tend to do with the Mame shortcuts.

I had the same problem designing an arcade cabinet for my kids. I thought infinite credits would make the games pointless but I didn't want to remove the continue option totally. That is why I designed a joystick system with an integrated credit counter. The system disables the insert coin buttons unless credits are available and includes a little challenge (a Simon Says game) that must be won in order to obtain them.

You can see the project at https://www.hackster.io/user3853574654/arcade-joystick-x4-plus-simon-game-384309 and https://github.com/gambaman/ArcadeJoystickX4PlusSimonGame. You can also see a video demo at https://youtu.be/ENW7n0ni5kg.
124490

ozfalcon
23rd February 2018, 09:53 AM
I had the same problem designing an arcade cabinet for my kids. I thought infinite credits would make the games pointless but I didn't want to remove the continue option totally. That is why I designed a joystick system with an integrated credit counter. The system disables the insert coin buttons unless credits are available and includes a little challenge (a Simon Says game) that must be won in order to obtain them.

You can see the project at https://www.hackster.io/user3853574654/arcade-joystick-x4-plus-simon-game-384309 and https://github.com/gambaman/ArcadeJoystickX4PlusSimonGame. You can also see a video demo at https://youtu.be/ENW7n0ni5kg.
124490

This is an interesting idea.

It would be nice if it used the existing P1/P2(P3/P4) buttons rather than a separate set.

Ideally 1 credit is given for each Simon sequence - Sequences getting longer for each credit.
(The video shows multiple sequences being played to get a single credit for each P1 & P2)

Looks a bit complicated as is - But a good concept.

gambaman
24th February 2018, 01:13 AM
This is an interesting idea.

It would be nice if it used the existing P1/P2(P3/P4) buttons rather than a separate set.


In fact it uses the existeng COIN1/COIN2/COIN3/COIN4 buttos, not a separate set. Also, in the new version of the firmware if an insert coin button is pressed when there are no available credits then a Simon game will start in the easiest level.



Ideally 1 credit is given for each Simon sequence - Sequences getting longer for each credit.
(The video shows multiple sequences being played to get a single credit for each P1 & P2)

Looks a bit complicated as is - But a good concept.
The video is a bit outdated. In the first version had the 4 skill levels of the original Simon Says. In the last version I added an easiest level with a maximun sequence length of just 4. The number of credits you get depend on the skill level you select as shown in this table:
124543
Anyway the source code is at github and can be modified to fit your needs.

buttersoft
13th March 2018, 10:08 AM
I have a mate who credit-feeds his way through everything despite the complaints, and it drives me bananas. The thought of my son growing up that way is untenable.

Hence I’ve managed to get a credit limiter going for Mame, based on adn0r’s script in this post (https://www.aussiearcade.com/showthread.php/6415-Limiting-credits-in-MAME?p=70818#post70818). That script worked as written at the time, but at present a few more steps are needed. (EDIT: the MAME devs changed around version 0.110 or something to rawinput as being a faster option, and you have to enable dinput now among other things). My updated script is below, and I’ve attached the standalone .exe as a rar file.

In short, each credit button works three times until you hit the mame exit key combo and then you go again. In Mame my exit key is actually three joystick buttons that individually are credit 1, p1 start and p2 start, which are also bound in joytokey to trigger w, a, and q + z depending on which you press, and my credit buttons in Mame are the default 5 and 6. The script should work with the standard esc key instead of q + z if you make that change.

To get this to work, you need the setkeydelay line as recorded, as even with the new dinput options i don't think Mame will accept (virtual?) keypresses of zero duration. And in mame.ini you must set “keyboardprovider dinput”. I find this better than the –keyboardprovider dinput commandline parameter as i'm using a frontend, and, for example, I can disable the limit function in sf2.ini by adding “keyboardprovider auto” and just binding the physical credit buttons to directly give credits in that game’s inputs only. It's possible that with something like an ipac the dinput setting will cause problems, but my joysticks and keyboard are unaffected in vanilla Mame, GM, and GM wolf. You'll have to try it and see :)

The ~ prefix means when I push the w key, I get w and then 5, the w does not get hidden from the system. Adn0r’s $ prefixes are not needed to hide the script's outputs from itself, as it is not using the 5 or 6 keys as inputs, so there is no danger of them triggering themselves off. This doesn't really make any difference to function, however.

If you want to change the script, just change the keys, and possibly google autohotkey prefixes. Then download atuohotkey and it really is as simple as opening the compiler exe and pointing it to the .ahk script file, which is just a txt file with another name. You could also use something like "WinWaitActive, MAME" to get the script to only trigger when Mame is active. Authotkey is pretty easy to learn as you go along. It'd be pretty easy to write something like the H2seq program out in it, if that didn't already exist :)



key5 := 0
key6 := 0

setkeydelay, 0, 50

~q & z::
key5 := 0
key6 := 0
return

~w::
key5++
if key5 <= 3
{
send, 5
}
return

~a::
key6++
if key6 <= 3
{
send, 6
}
return

125484