Author Topic: YA-GOLF MINI Super challengue  (Read 15415 times)

0 Members and 1 Guest are viewing this topic.

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
YA-GOLF MINI Super challengue
« on: July 10, 2012 »
« Last Edit: July 12, 2012 by SERGIO_ManOwaR_ »

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
Re: YA-GOLF MINI Super challengue SOURCE CODE CUTTED
« Reply #1 on: July 10, 2012 »

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: YA-GOLF MINI Super challengue
« Reply #2 on: July 10, 2012 »
I've seen a lot of cool stuff made with Yabasic and this ranks among it..

I simply cannot believe how much hard work you must have put into this game!  It's really good and people who run this in the emulator need to know how limited PS2 Yabasic is and what a great job you've done here.

Excellent work :)

I just hope that lots of people download the emulator so that they can see this.
Shockwave ^ Codigos
Challenge Trophies Won:

Offline combatking0

  • JavaScript lives!
  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4569
  • Karma: 235
  • Retroman!
    • View Profile
    • Combat King's Barcode Battler Home
Re: YA-GOLF MINI Super challengue
« Reply #3 on: July 10, 2012 »
My son loves golf, so we'll definitely give this a try.

It must have taken ages to put together.
You are our 9001st visitor.
Challenge Trophies Won:

Offline Raizor

  • Founder Member
  • Pentium
  • ********
  • Posts: 1154
  • Karma: 175
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #4 on: July 10, 2012 »
That's really great Sergio. Excellent presentation, great stuff :)

K++ for sharing the source.
raizor

Challenge Trophies Won:

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
YA-GOLF MINI Vr. 0.5.2
« Reply #5 on: July 10, 2012 »
OMG... first release and first tons of bugsss  :-[ Last hour changes....motion replay doesn't work properly and some other stuff.

Maded a quik fix for this and release vr. 0.5.2 to download at the end of this post.

Thanks Shockwave for you really aprecciate the difficults of programming in yabasic where all you have is a blank page and nothing more. You know it very well, i've seen many codes for yabasic you wrote and yes its really a hard job.
Thanks combatking also for give it the chance.. hope you like! I also like golf but the physics for the golf are still too difficult to understand for me.
and thanks Razor! Finally i've started sharing and im very happy to see you aprecciate it.


Hope someday could make the perfect version with no bugs.. but that day is yet far away...

Can't believe so many people still interested in yabasic... now i feel i can keep on sharing more stuff and i WILL DO!

I'M VERY GLAD TO SEE SOME FEEDBACKS AND YABASIC STILL ALIVE!! See you and Thanks you all! :D

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #6 on: July 11, 2012 »
Great!  That must have taken you forever!

Quote
Seems that source code is TOO LONG for the page and it's cutted
Sure, it's HALF A MEG of yabasic code - easily the biggest yabasic program I've ever seen! :)

Jim
Challenge Trophies Won:

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
About DUALSHOCK 2 In the emulator. (and more)
« Reply #7 on: July 11, 2012 »
...And ever... and ever....  :stirrer: still haven't reached version 1.0

Hi jim!! Nice to meet you!! Finally got something to share... and show yabasic can do good things in the emulator... and even better! :D

I've been very bussy trying to understand how the emu works and now starting to have more experience about what can be done on it (except an .exe file ,isn't it? :'( ) and im really happy for working in the emulator, where each day have a lot of ideas and old projects maded for the ps2 that wantssssssss to be rewrited for the emu and look great! Thanks a lot for the emu, can't stop`saying!

Many people probably won't know that some of the emu's options allows to perform great results for such languaje as yabasic... animations, bitmaps and lots of amazing things can be done.. it's so funny! :D

Thanks for the feedback, the game is really long, i can almost say that a wrote a book ahahah but most of the size is because of the bitmaps data.
Early versions had until 1 mb but now the bitmaps are compressed to save around 60% original size, and still can be reduced more by using run lenght algorithm or 216 color represented by a simple ascii character wich means 1 PIXEL= 1 Byte but it's ok like this.


I have a question for you and I leave it here co's maybe other people should also help on it.

Im very interested on the compatibility with the dualshock 2.
Got a original SONY DS2 plugged to PC Via USB CONVERTER with the right drivers and everything ok. But.... when i make a test to see the pressed keys (with peek("port1")) results that some buttons doesn't work, and others are changed.

Is it a particularity of the emu or maybe i just need another converter and driver?

The arrow keys are the worst... it doesnt work at all for me, but at least when I turn ON the ANALOG button, got a response... but, you know that arrow keys corresponds to peek"port1" numbers 16,32,64,128 and what I got is: 256,512,1024,2048 :O

That won't be a major problem since i can remap the controls for my game in a options menu in case you choose dualshock, the peek " port1" wold change numbers and work ok, but i would like to know if these numbers 256,512,1024,2048 are fixed and everybody has the same test peek "port1" result or it is just me!

It would be a lot of work to change everything in the games and later realise that the changes for the dualshock works only for me and not for everybody. So please if anybody has a dualshock 2 plugged in the pc can do a peek port1 test and chek what numbers get? That would be very usefull for me. Can use this code:

Code: [Select]

REM --------------------------------------------------------
REM CHEK PORT 1 TEST.
REM --------------------------------------------------------
REM PLEASE Plug an original wired sony dualshock 2 and test if
REM It works properly pressing some buttons and cheking if
REM the key_number given corresponds to the original key_number
REM The results will be displayed at the PS2 console window.
REM SEE THE TABLE BELOW FOR THE ORIGINAL KEY_CODES.
' ------------------------------------------------------------
' NAME OF THE BUTTON ' ORIGINAL KEY_CODE
' ------------------------------------------------------------
' SELECT                       1
' L3                           2
' R3                           4
' START                        8
' ARROW UP                    16
' ARROW RIGHT                 32
' ARROW DOWN                  64
' ARROW LEFT                 128
' L2                         256
' R2                         512
' L1                        1024
' R1                        2048
' TRIANGLE                  4096
' CIRCLE                    8192
' CROSS                    16384
' SQUARE                   32768
' ------------------------------------------------------------

1

clear screen
? "------------------------------------------------"
? "PRESS ANY BUTTON IN YOUR DUALSHOCK 2 CONTROLLER"
? "------------------------------------------------"
? "You will obtain a number that corresponds to a key_code."
? "Compare your key_code with the origibal DS key_codes."
? "If the button you pressed matches the original key_code"
? "and button name you were pressing, ITS OK!"
? "------------------------------------------------"
? "Please chek all buttons, especially POV CONTROL"
? "(ARROWS) AND L3,R3"
? "------------------------------------------------"
? "THE BUTTON \"ANALOG\" DOESN'T HAVE A KEY CODE, BUT"
? "BY ACTIVATING ANALOGUE MODE, OTHER BUTTONS KEY_CODES"
? "MAY BE AFFECTED AND CHANGES. PLEASE TRY AS WELL."
? "------------------------------------------------"

repeat key=peek("port1") until(key>0)
if key=0 goto 1
clear screen
? "------------------------------------------------"
print "KEY PRESSED:";:? key;:print "          Is it right?"
' ? "------------------------------------------------"
' ?" NAME OF THE BUTTON  ORIGINAL KEY_CODE"
? "------------------------------------------------"
? "SELECT                       1"
? "L3                           2"
? "R3                           4"
? "START                        8"
? "ARROW UP                    16"
? "ARROW RIGHT                 32"
? "ARROW DOWN                  64"
? "ARROW LEFT                 128"
? "L2                         256"
? "R2                         512"
? "L1                        1024"
? "R1                        2048"
? "TRIANGLE                  4096"
? "CIRCLE                    8192"
? "CROSS                    16384"
? "SQUARE                   32768"
beep
repeat no_key=peek("port1") until (no_key=0)
goto 1


 

Using the dualshock would be great.. in fact i haven't resist the temptation to implement it in my games, as a hiden option in the source code until i can understand how this works and made menus for choosing controls.
Another peculiarity of the DS in emu is that when you have the DS plugged, the keyboard keys start to fail and peek"port1" becomes buggie and peek flush interrupted. I guess this is because the emu centers all his atention in peek USB PORTS instead of keyboard emulated DS.

Well i'm sorry for the extensive post, to much talk about dualshock !! maybe i would have better start a new post for the dualshock 2? Anyway here it is.

As I said, nice to meet you again JIM, see u! :)

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #8 on: July 12, 2012 »
When I wrote the joystick stuff for the emulator I was using the same as you, a DS2 attached via USB.  If I can find it I'll try out the code again, but I would have done the most logical thing and that means you might have to remap the buttons in the game.

That would suck.

Most of the joystick drivers these days come with a configuration control panel that lets you remap buttons - does yours have that?

Jim
Challenge Trophies Won:

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: YA-GOLF MINI Super challengue
« Reply #9 on: July 12, 2012 »
Great!  That must have taken you forever!

Quote
Seems that source code is TOO LONG for the page and it's cutted
Sure, it's HALF A MEG of yabasic code - easily the biggest yabasic program I've ever seen! :)

Jim

If Wenlock decides to type this in it will keep him busy for a long time!

When we were all using this on the PS2 the size of the listing was detrimental to the frame rate... It's really nice to see what can be done without these silly limitations.

Shockwave ^ Codigos
Challenge Trophies Won:

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
About DUALSHOCK 2
« Reply #10 on: July 12, 2012 »

Most of the joystick drivers these days come with a configuration control panel that lets you remap buttons - does yours have that?


Hi jim!! Ive tried most of the drivers and softwares for usb dualshock converters. Even some very usefull profilers like motioninjoy which allows to remape everything, but it doesn't recognize dualshock 2, only dualshock 3... so i can't go any far.. just waiting for any results if anybody can do the peek("port1") test and then decide what do about it.

I've been thinking that maybe some people just plug and play ok but any other with the same usb converter that i have will probably get the same result so it would be a good idea create some kind of "profiles" in games to be choosen until the user's dualshock becames 100% compatible. That would be a solution.  cheers!

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
FORCING FLUSH RATE
« Reply #11 on: July 12, 2012 »

If Wenlock decides to type this in it will keep him busy for a long time!

When we were all using this on the PS2 the size of the listing was detrimental to the frame rate... It's really nice to see what can be done without these silly limitations.

Sure! It's exactly 12225 lines of surce code... i can imagin that... weeks and weeks of hard work... and then finally.... time to PRESS START AND ENJOY.....  and then... ERROR!  :o Typing mistake!!! OMFG!!! ;D

Any way, this versions won't work on the ps2 cos' i've started to programm for the emu and the game is intended to flush at 60 FPS.  In ps2 may be work at 0.01 FPS actually with the bitmaps.... hahah

Yes it's really silly limitations... most of my projects were abandoned when i reached the point of FPS DECREASE... and you now.. that's a point of no return!

When fps started to decrease under 24 fps and still so much code to be written i can only say: SH*T!! Another one for the thrash...

Actually im very interested on force flush rate routines. The emu has his own option to force it but it makes the game a little bit limited. When force flush rate is OFF, the game can draw as fast as possible, just as fast as your cpu can do it.
That means that some pcs may show the game at 30 fps and some others could do it at 80 FPS or maybe more... then need to force flush rate from the source code itself.

My first idea was to add pauses  when game is running quiqcly... that was a poor idea, since the FPS RATE could only be checked after one second (of course) adding pauses make the game freeze sometimes until next FPS RATE CHEK decides that there's no need to pause the game. Pause games was quicky rejected.
My second idea consists in leave the game freely drawing as quiqly as it cans, and compensate the slow/quiqck frame rate differences by drawing polygons or something hiden under the "clear window" screen. This means that the game is always drawing AS MUCH POLYGONS AS IT CAN, increasing or decreasing the number of hidden polygons to be drawed until the fps rate is exaclty the fps we want. I dont know if it is a good idea cos' may be to many work for the processor or some... i don't know very well how the hardware works.
At the moment this way to force flush rate is giving me good result but it is still beeing modified to get the optimal routine that can decide  how many polygons draw at any moment to do the perfect compensation. Great differences between screens takes time to compensate (for example draw a bitmap 50x50 pixels= 2500 rectangles) when suddenly stop drawing something big, the FPS RATE increases from 60 to 75 (or maybe more) and needs to be quiqly compensate. Im working so hard in this. Theres a way to quick compensate by keeping the number of polygons drawed on each frame and then discount this value form the hiden poligons to be drawed... but still takes time. The routine is always tring to display game at 60 FPS... if it can't be done for a while, then tries to play at 59...58..59.... and start reducing the number of polyonos and textures (most textures are also hidded on this versions)  untill it can flush smooth.Low Frame rates will result in a worst (but quiqly) bitmaps quality and some other adjust and even the bitmaps can be automatically disabled by the routine if it can work with a minimum of 40 FPS.

So many work with the flush rates and still workin on it. One of the worst things is that the routine takes some time to reach the optimal fps when the game starts so i think that i must do a screen for selecting video quality and leave the routine chek performance for a few seconds to decide how many hiden polygons will be a good choose for starting the game. During the game the routine is permanently doing his work.... but needs to be adjusted for a better performance.

Forcin flush rate from the source code itself may not be a good idea but at this point i was forced to do it cos the game runs slowly with the bitmaps.

Would  like to see some ideas or suggestions about FPS FORCE FLUSH RATE, wich is something that i would never had to handle (cos the ps2 works exacly the same for everybody) but when i tested my game in different pcs was shocked to see so many different results...

see u shockwave!

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #12 on: July 15, 2012 »
Hi Sergio,
When I use up/down/left/right with my USB adapter and DS2, I get the same as you
Up 256
Right 512
Down 1024
Left 2048

Looks like a made a mess when I mapped them as these are the same numbers I get by pressing L2,R2,L1,R1

Jim
Challenge Trophies Won:

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #13 on: July 15, 2012 »
Hi Sergio,
When I use up/down/left/right with my USB adapter and DS2, I get the same as you
Up 256
Right 512
Down 1024
Left 2048


Thx so much jim, i was very intrigated about that, so it's very usefull info for me.
So i guess everybody will get the same peek, that means no need to do different profiles for dualshock, just one adapted for that combination. Have a  nice remap routine anyway and its very usefull.
The bad news are that there are 4 keys lost... i'm working in a point n click adventure originally writed for PS2 when the game uses all the buttons for dualshock and it's impossible to emulate with 4 missin in action keys... but as usually, when things go wrong, the ideas gets better, and the 4 keys losed can be emulated in some other ways, for example by double taping some keys... and it's actually maded! :)

see you!

Offline Wenlock

  • C= 64
  • **
  • Posts: 68
  • Karma: 4
  • BASIC & Testcards rule.
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #14 on: September 12, 2012 »
I doubt I'd do it as it only works in the emulator, got the code and WILL have a look on the emulator.

Wenlock
YABASIC ROOLZ!

Offline rain_storm

  • Here comes the Rain
  • DBF Aficionado
  • ******
  • Posts: 3088
  • Karma: 182
  • Rain never hurt nobody
    • View Profile
    • org_100h
Re: YA-GOLF MINI Super challengue
« Reply #15 on: September 15, 2012 »
Amazing work, I'm surprised that you managed to fit so many images into the source code when it's less than 600 KB. That alone is impressive. The overall design is worthy of praise. Much as I love yabasic, your skills are wasted on such a restrictive platform.

Challenge Trophies Won:

Offline Yaloopy

  • Death From Above
  • DBF Aficionado
  • ******
  • Posts: 2876
  • Karma: 35
    • View Profile
    • UltraPaste
Re: YA-GOLF MINI Super challengue
« Reply #16 on: August 10, 2013 »
Wow, this is amazing. Hadn't seen it before.

It even has an instant replay of your shot. Brilliant.

Any sign of Sergio since?
Fuck L. Ron Hubbard and fuck all his clones.
Challenge Trophies Won:

Offline MrD

  • C= 64
  • **
  • Posts: 31
  • Karma: 8
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #17 on: February 05, 2016 »
Hi sergio! What does 'WARNING LOW PC EFFICIENCY' mean?

Offline SERGIO_ManOwaR_

  • C= 64
  • **
  • Posts: 48
  • Karma: 9
    • View Profile
Re: YA-GOLF MINI Super challengue
« Reply #18 on: February 25, 2016 »
HI! and thanks for some feedback after so many time i haven't posted replays here.
First say that ive worked so much in this game and latest version includes:New graphic engine with zooming and scrooling and tvcam routines to follow ball. New putter stick club vector animation (pretty interesting since it's created with an interpolation of only 2 frames) betters graphics, colors and textures. Dualshock compatible. New RANDOM mode, that creates a camp with fully randomiced holes and terrains. New 'auto-aiming' mode, wich allow to move a pointer across screen (like a FPS SHOOTER game) and putter stick club will follow trajectory and lots of stuff, but... i'm really frustrated because collision detection are bad and still gives some bugs that are reallyu a shame... anyway, i may update version some day.
For mrd, that is really working hard for made not only this game but any others compatible with his online JS emulator, answer that this message you comment is part of the MESS i have in the code in a try to FORCE FLUSH RATE.
Game supposed to run at 60 FPS. Jimshaw emulator's allow to force flush rate to 50,60 or not force at all, but im including my own built-in force flush rate routines.
This consists, basically, in drawing (hidded) thousands of circles until FPS fits the FPS desired.
The more FPS, the more circles will be drawed until a certain amount of circles allows to have an stable FPS. IF FPS runs low of desired FPS, the amount of circles will be decreasing until reaches ZERO.
Also is working a background textures effect similar, when FPS runs low than 60 fps, number of textures decrease to zero. (Really ugly effect cos' you can see them real time dissapearing )
This have several consecuences:
First, i guess cpu is been FORCED to the limit... i dunno
Second, when a graphic event happens, such as suddenly appear or dissappear a text, or a bitmap or anything, fps decreaseases inmediately, and the FORCE FLUSH RUTINE takes some time to COMPENSATE it decreasing number of circles..
Ive been trying for a long some ideas such as make a count  of all graphic events per frame then substract to the number of force flush rate circles to be drawed... anyway it's really hard to have a game running at 60 fps smoothed..
Well, im saying all this for you understand the context of those messages.
I really don't know exacxtly right know values and other stuff, but i remember this:
When FPS runs under 60 fps, some routines are working for trying to fix.
The textures decreseases, the quality of text decreases, bitmaps and even the whole display info may be FORCED to dissapear...
If FPS really runs low (maybe under 30), a message is displayed in a window to show user
that game is running low and some tips to TRY fix it. (First try is disable emulator force flush rate and let the game control FFR)
After a countdown, if FPS still runs low, a var called 'slow_cpu' is activated, then it affects to several parts of the source, causing most of graphical effects to be disabled or quality reduced.
As a say.. all this is a MESS, and on later versions i've tried lots of different things...
I just want to tell...sorry for the boring! :D
Im reading your progress with the JS and will post replys, cheers!