Jump to content



Photo
* * * * * 26 votes

WIP: Visual Pinball in Unity


  • Please log in to reply
813 replies to this topic

#301 Lynny

Lynny

    Enthusiast

  • Platinum Supporter
  • 130 posts

  • Flag: United States of America

  • Favorite Pinball: Target Alpha, Evel Knievel, Creature From The Black Lagoon, 8 Ball Deluxe

Posted 16 June 2020 - 01:59 PM

Freezy,

 

Thanks for the reply.  I'm wondering now, if I've buggered up the repo download...or something.  I'm kinda new to this, so its quite possible..I'll have to make sure, somehow, that I have the latest version of the repo files...because I really wanna play with this....  :-)

 

 

Peace,

Lynny


Hi there !

 

Here's a glance view to the Drag-points Editor i'm working on for the project.

 

https://www.youtube....h?v=a2ncd2EsQoM

 

Almost done, still some drag-point properties settings left and some little Ux fixes.

Hope you'll enjoy it.

 

Cheers

Vroonsh,

 

I probably misspelled that..sorry...Man, I am in awe of your work, and this is no exception, that looks fantastic..  Before you know it, we'll have a VR editor, and be able to build tables in VR, from a construction set...  I love it...can't wait to play with that..  ;-)

 

 

Peace,

Lynny


Peace,
Lynny

#302 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 16 June 2020 - 02:07 PM

@Lynny,

 

Definitely use git instead of downloading a zip file every time. Depending on how comfortable you are on the command line, grab git here, then

cd c:\parent-dir-where-you-want-to-copy-vpe
git clone https://github.com/freezy/VisualPinball.Engine.git

Then, every time you want to update:

cd c:\parent-dir-where-you-want-to-copy-vpe\VisualPinball.Engine
git pull

If you prefer a UI, there's Fork, GitKraken and SourceTree, all are pretty powerful, but you will need some basic understand how git works. There's also TortoiseGit, a windows explorer extension, but I haven't used that in decades. If you're just planning to pull in the latest changes, I would try Tortoise first, it might let you just right-click on your folder and choose "git pull", otherwise the command line might work as well, at least that's where I will be able to help you most with. ;)



#303 Lynny

Lynny

    Enthusiast

  • Platinum Supporter
  • 130 posts

  • Flag: United States of America

  • Favorite Pinball: Target Alpha, Evel Knievel, Creature From The Black Lagoon, 8 Ball Deluxe

Posted 16 June 2020 - 03:47 PM

Freezy,

 

You're too kind. I really appreciate the help.  I just installed all that, and pulled it in this way, from the command line.  Maybe now we'll find out where I'm cocking it up.  Prior to that I installed github desktop, and cloned it there, the resulting offspring did not fly, as it were...same error about a Nullobject can't be null..I'm about to open a project, import the VPE files and try again.  Last time I used the Example table again, to test...imported, and exported, didnt touch a thing...ERROR..

 

What table have you successfully imported and exported?  I'm trying to eliminate any and all variables to pinpoint the error of my ways...I wish there were a youtube video tutorial..it doesnt sound that difficult, but I have to be missing a step somewhere along the line..   :-)

 

 

Update:  I just repeated the process, with what I can only assume to be the freshest, newest version of the files, and used my same example table, and imported, and immediately exported again, and I got the same error.  

 

"ArgumentNullException: Value cannot be null."


Edited by Lynny, 16 June 2020 - 03:59 PM.

Peace,
Lynny

#304 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 16 June 2020 - 06:50 PM

Hey Lynny,

 

The error message is interesting, but it can basically happen anywhere in the code, that's why the stack trace is really important in order to see what's going on. Can you paste that as well please (see here)?


Edited by freezy, 16 June 2020 - 06:51 PM.


#305 Lynny

Lynny

    Enthusiast

  • Platinum Supporter
  • 130 posts

  • Flag: United States of America

  • Favorite Pinball: Target Alpha, Evel Knievel, Creature From The Black Lagoon, 8 Ball Deluxe

Posted 16 June 2020 - 08:20 PM

Freezy,

 

I'm so sorry, I forgot all about you asking for that, too.. Here is the cut n paste of it..

 

ArgumentNullException: Value cannot be null.
Parameter name: second
System.Linq.Enumerable.Concat[TSource] (System.Collections.Generic.IEnumerable`1[T] first, System.Collections.Generic.IEnumerable`1[T] second) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
VisualPinball.Engine.IO.BiffData.Write (System.IO.BinaryWriter writer, System.Collections.Generic.Dictionary`2[TKey,TValue] attributes, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/IO/BiffData.cs:171)
VisualPinball.Engine.VPT.BinaryData.Write (System.IO.BinaryWriter writer, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/BinaryData.cs:68)
VisualPinball.Engine.VPT.BiffBinaryAttribute.Write[TItem] (TItem obj, System.IO.BinaryWriter writer, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/TextureData.cs:102)
VisualPinball.Engine.IO.BiffData.Write (System.IO.BinaryWriter writer, System.Collections.Generic.Dictionary`2[TKey,TValue] attributes, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/IO/BiffData.cs:178)
Rethrow as InvalidOperationException: Error writing [BiffBinaryAttribute] at "JPEG" of TextureData Image47.
VisualPinball.Engine.IO.BiffData.Write (System.IO.BinaryWriter writer, System.Collections.Generic.Dictionary`2[TKey,TValue] attributes, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/IO/BiffData.cs:181)
VisualPinball.Engine.VPT.TextureData.Write (System.IO.BinaryWriter writer, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/TextureData.cs:75)
VisualPinball.Engine.IO.BiffData.GetBytes (VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/IO/BiffData.cs:54)
VisualPinball.Engine.IO.BiffData.WriteData (OpenMcdf.CFStorage gameStorage, VisualPinball.Engine.VPT.Table.HashWriter hashWriter) (at D:/VisualPinball.Engine/VisualPinball.Engine/IO/BiffData.cs:47)
VisualPinball.Engine.VPT.Table.TableWriter.WriteImages () (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/Table/TableWriter.cs:105)
VisualPinball.Engine.VPT.Table.TableWriter.WriteTable (System.String fileName) (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/Table/TableWriter.cs:40)
VisualPinball.Engine.VPT.Table.Table.Save (System.String fileName) (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/Table/Table.cs:158)
VisualPinball.Unity.Editor.Inspectors.TableInspector.OnInspectorGUI () (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity.Editor/Inspectors/TableInspector.cs:44)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <af78ad00a40d4f61b82afc6cafb0a416>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

 

Hopefully something may be gleaned from that mess..  :-)


Peace,
Lynny

#306 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 16 June 2020 - 08:44 PM

Huh, interesting. Looks like a bug indeed!

 

Can you send me the .vpx file you're trying to save so I can reproduce? Best would be to zip it, open a GitHub issue and just drag and drop the zip file from the explorer into the comment text box. It will upload it automatically.

 

Thanks!



#307 Lynny

Lynny

    Enthusiast

  • Platinum Supporter
  • 130 posts

  • Flag: United States of America

  • Favorite Pinball: Target Alpha, Evel Knievel, Creature From The Black Lagoon, 8 Ball Deluxe

Posted 16 June 2020 - 11:10 PM

Freezy,

 

The file has been sent.  I just did an import of an empty table, the one you get when you select NEW, and it asks you if you want blank table, or example table, and it had errors on import. 

 

FileNotFoundException: Could not load file or assembly 'System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
System.MemoryExtensions..cctor () (at <a5006ea2ea344a8e8c71a2eb982aadc0>:0)
Rethrow as TypeInitializationException: The type initializer for 'System.MemoryExtensions' threw an exception.
NetVips.Image.FindLoadBuffer (System.Byte[] data) (at <7c619ef10a1842ddae3a8af52c0e1901>:0)
NetVips.Image.NewFromBuffer (System.Byte[] data, System.String strOptions, System.String access, System.Nullable`1[T] fail, NetVips.VOption kwargs) (at <7c619ef10a1842ddae3a8af52c0e1901>:0)
VisualPinball.Engine.VPT.Texture.GetImage () (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/Texture.cs:131)
VisualPinball.Engine.VPT.Texture.Analyze () (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/Texture.cs:73)
VisualPinball.Engine.VPT.PbrMaterial.AnalyzeMap () (at D:/VisualPinball.Engine/VisualPinball.Engine/VPT/PbrMaterial.cs:65)
VisualPinball.Unity.Import.Job.MaterialJob.Execute (System.Int32 index) (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity/Import/Job/MaterialImporter.cs:69)
Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <3dc54541a2574ac7826a004a212a4332>:0)
Unity.Jobs.JobHandle:ScheduleBatchedJobsAndComplete(JobHandle&)
Unity.Jobs.JobHandle:Complete()
VisualPinball.Unity.Import.Job.MaterialImporter:ImportMaterials() (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity/Import/Job/MaterialImporter.cs:34)
VisualPinball.Unity.Import.VpxImporter:ImportMaterials(Dictionary`2) (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity/Import/VpxImporter.cs:114)
VisualPinball.Unity.Import.VpxImporter:Import(String, Table, IAssetHandler) (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity/Import/VpxImporter.cs:82)
VisualPinball.Unity.Editor.Import.VpxMenuImporter:ImportVpx(String, Boolean) (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity.Editor/Import/VpxMenuImporter.cs:80)
VisualPinball.Unity.Editor.Import.VpxMenuImporter:ImportVpxEditor(MenuCommand, Boolean) (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity.Editor/Import/VpxMenuImporter.cs:52)
VisualPinball.Unity.Editor.Import.VpxMenuImporter:ImportVpxEditorAsset(MenuCommand) (at D:/VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity.Editor/Import/VpxMenuImporter.cs:25)

 


Peace,
Lynny

#308 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 17 June 2020 - 09:01 AM

Thanks Lynny, will have a look at those later on. I'll keep you posted.

 

Just merged the plunger code.

 

84700000-c5dd1180-af52-11ea-8380-2b5dc23

 

And there is some good news: Thanks to @jsm174, we're starting to get this running on macOS, and probably Linux soon too!



#309 VrôÔnsh

VrôÔnsh

    Neophyte

  • Members
  • Pip
  • 5 posts

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

  • Favorite Pinball: 8Ball Deluxe, AFM, IJ, TOM, Who Dunnit, ACDC Luci, FlintStones

Posted 23 June 2020 - 06:08 PM

Vroonsh,

 

I probably misspelled that..sorry...Man, I am in awe of your work, and this is no exception, that looks fantastic..  Before you know it, we'll have a VR editor, and be able to build tables in VR, from a construction set...  I love it...can't wait to play with that..  ;-)

 

 

Peace,

Lynny

 

 Hey Lynny, Vroonsh is ok ;) 

 

Yeah a VR Editor would be really awesome.

An updated version of the drag points editor is on its way, let me know if i can be of any help on the VR edition part (no hardware yet, maybe this year :D).

 

Cheers !

 

VroOnsh



#310 Lynny

Lynny

    Enthusiast

  • Platinum Supporter
  • 130 posts

  • Flag: United States of America

  • Favorite Pinball: Target Alpha, Evel Knievel, Creature From The Black Lagoon, 8 Ball Deluxe

Posted 24 June 2020 - 03:42 AM

VroOnsh,

 

I've had a pincab for a few years now.  Its fun, but VR will blow your mind.  I can't wait to see where all this will take us, but I'm along for the ride..  :-)


Peace,
Lynny

#311 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 24 June 2020 - 09:47 PM

I got a bit side tracked by trying get a nice segment display rendered on the GPU. It's a pixel shader:

 

85446582-e7627c80-b594-11ea-8ef5-19763fd

 

However I'd like to add the glowing effect and I can't get the clamp to fade smoothly:

 

unknown.png

 

Anyone with shader skills in here? I think the VPVR guys are pretty good at it, but if @toxie or @fuzzel you want to have a look, it would be a good addition to VP as well :)

 

My current WIP is here.



#312 Rawnei

Rawnei

    Enthusiast

  • Platinum Supporter
  • 319 posts
  • Location:Stockholm, Sweden

  • Flag: Sweden

  • Favorite Pinball: There's too many good ones but I really love the atmosphere in Cirque Voltaire!

Posted 25 June 2020 - 06:41 AM

I got a bit side tracked by trying get a nice segment display rendered on the GPU. It's a pixel shader:

 

However I'd like to add the glowing effect and I can't get the clamp to fade smoothly:

 

Anyone with shader skills in here? I think the VPVR guys are pretty good at it, but if @toxie or @fuzzel you want to have a look, it would be a good addition to VP as well :)

 

My current WIP is here.

 

I'm not really, lots of trial and error just trying to fix broken stuff. :P

 

Toxie is the shader god.
 



#313 VrôÔnsh

VrôÔnsh

    Neophyte

  • Members
  • Pip
  • 5 posts

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

  • Favorite Pinball: 8Ball Deluxe, AFM, IJ, TOM, Who Dunnit, ACDC Luci, FlintStones

Posted 03 July 2020 - 10:03 PM

Hey everyone,

 

Drag points editing is now fully fonctionnal on VPE

 

All VPX features are present : 

- supports ramps, rubbers, surfaces, triggers

- lock/unlock

- add/remove

- move, height support, multi selection

- properties editing (smooth, slingshot, texture)

- copy /paste

- flip

- undo/redo

 

https://www.youtube....h?v=6oV6LsZJo_o

 

Thansk again freezy for your patience and all the c# clues  ;).

 

Thanks also to Mussinger for the fantastic Iron Maiden table full of looooong ramps  :)

 

Cheers !


Edited by VrôÔnsh, 03 July 2020 - 10:06 PM.


#314 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 03 July 2020 - 10:08 PM

Cheers man, awesome stuff!



#315 blindpeser

blindpeser

    Enthusiast

  • Members
  • PipPipPip
  • 421 posts

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

  • Favorite Pinball: WCS94

Posted 04 July 2020 - 05:49 AM

Looks neat! Pretty excited for the upcoming updates.

#316 toxie

toxie

    VPF Veteran

  • VP Dev Team
  • PipPipPipPipPipPip
  • 5,734 posts
  • Location:berlin, germany

  • Flag: Germany

  • Favorite Pinball: AFM

Posted 04 July 2020 - 06:40 AM

I got a bit side tracked by trying get a nice segment display rendered on the GPU. It's a pixel shader:

 

 

 

However I'd like to add the glowing effect and I can't get the clamp to fade smoothly:

 

 

 

Anyone with shader skills in here? I think the VPVR guys are pretty good at it, but if @toxie or @fuzzel you want to have a look, it would be a good addition to VP as well :)

 

My current WIP is here.

I think distance functions are what you want: Here a lib that one of my friends (cupe) mainly helped to code up: http://mercury.sexy/hg_sdf/

The major problem will be (similar to the smoothed DMD dot code i did for VPX) how to do proper anti-aliasing for small scales. There are analytic ways for sure, but i failed to properly derive it and thus resorted to brute force oversampling for the dots.



#317 CameronMcGehee

CameronMcGehee

    Hobbyist

  • Members
  • PipPip
  • 15 posts

  • Flag: United States of America

  • Favorite Pinball: Taxi

  • PS3 Gamer Tag: Dont have a PS3
  • 360 Gamer Tag: Dont have a 360

Posted 07 July 2020 - 05:04 AM

I wish I knew how all this stuff worked and how to interpret the code so I could help you all out...unfortunately I don't think my web development skills help here haha...but this looks really great and please keep working on it! Hope this ends up improving virtual pinball for all of us!



#318 freezy

freezy

    Member title

  • Members
  • PipPipPipPip
  • 685 posts

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

  • Favorite Pinball: T2, TOM, AFM

Posted 07 July 2020 - 10:28 PM

@Lynny not sure where your post went, but great feedback (I still have it in my mail). Timers should actually be exported, will look into that. Actually, as far as I know, everything but fonts should currently be imported and exported.

 

I'll check the other issues and try to reproduce and get back to you if I need more information.

 

Cheers!



#319 Lynny

Lynny

    Enthusiast

  • Platinum Supporter
  • 130 posts

  • Flag: United States of America

  • Favorite Pinball: Target Alpha, Evel Knievel, Creature From The Black Lagoon, 8 Ball Deluxe

Posted 07 July 2020 - 10:36 PM

 Thanks to Freezy for being super quick draw on reading this forum...my deleted post has returned...lolol...for better or worse...

 

So, just real quick. I was doing a little personal testing the other day, importing tables, and attempting to export them right back out again, with no changes made whatsoever. I originally tried to keep it simple, ie the blank table, and the example tables, and had no luck with them (using that build). I need to test them again, with the newest build. So, I thought what the heck, I'll go in the other direction, and go for COMPLEX..lol..and see how that does. My most recent testing results were about 3 of the 10 I tried, would successfully import, and successfully export back out, ie, producing a VPX file at all. 1-2, possibly all 3, (I don't remember) successfully loaded back into VPX. The first thing I noticed, based on the script errors that I was getting, was that NO TIMERS are being exported, at all..I don't know if its something that is already known, but thats what I experienced in all 3 exported files. I manually copied the timers over on 1-2 tables and got the tables to run, but there was no video displayed. I could see, on the DMD, and hear the sounds of the table playing...somewhere..lol..but the player window that opened was black...nothing. The three tables I successfully exported were AC/DC, Creature from the black lagoon VR room, and that table that we don't mention.


Edit:

While I was writing this I decided to go back and test the SIMPLE tables again, that failed with the older build.

Blank table imported, exported, loaded and played. The process does something to the lighting though, as seen in the photos I'll attach. The lighting that is normally behind the player, is gone, and its all dark...ball is almost invisible..

Example table imported, and did NOT export, giving the same error I have seen on the other 6 tables I tested the other day.


AC/DC exported, but did NOT load, gave an error "could not uncompress primitive vertex data, error -3"

Creature from the black lagoon exported and played, but with no video output in the player window. It seemed to be the poster child for success.
UPDATE:
Creature imported with zero errors, and 2 warnings, but now fails to export, file is corrupted..

I have to throw in here, what you guys have accomplished with the import module in Unity Editor so far, is absolutely amazing..seeing how it pulls in the table and recreates it, in Unity...wow..its awesome. Which is why I'm so exited to see the results exported back out. I can't wait to be able to work on a table design in this beautiful editor.. :-)

If I dont cock this up, this should be comparison pictures of the current editor, and the Unity editor, with the same table loaded.

I hope you enjoy these pictures as much as I do, when you get down, and up close like this, you can really see them as things of beauty. These are from Target Alpha. If anyone has any they would like to see up close, and doesnt have the setup to be able to see them, let me know, and I'll see what I can do.. ;-)

Current Editor
https://imgur.com/wFURiwF (https://imgur.com/wFURiwF)

Unity Editor
https://imgur.com/XtzyYkC (https://imgur.com/XtzyYkC)

Current Editor
https://imgur.com/w8M3U1h (https://imgur.com/w8M3U1h)

Unity Editor
https://imgur.com/5aIVDV7 (https://imgur.com/5aIVDV7)

Current Editor
https://imgur.com/jKfxF0s (https://imgur.com/jKfxF0s)

Unity Editor
https://imgur.com/EUlcwO9 (https://imgur.com/EUlcwO9)

Current Editor
https://imgur.com/62mAJcl (https://imgur.com/62mAJcl)

Unity Editor
https://imgur.com/XtzyYkC (https://imgur.com/XtzyYkC)

Current Editor
https://imgur.com/YQkIaXe (https://imgur.com/YQkIaXe)

Unity Editor
https://imgur.com/eWmS1l4 (https://imgur.com/eWmS1l4)

some other pics, possible repeats..sorry.. :-)

https://imgur.com/QNc7aRd (https://imgur.com/QNc7aRd)

https://imgur.com/35tDnJN (https://imgur.com/35tDnJN)

https://imgur.com/xK9xJLk (https://imgur.com/xK9xJLk)

https://imgur.com/QonafSM (https://imgur.com/QonafSM)

https://imgur.com/c8ty8mG (https://imgur.com/c8ty8mG)

https://imgur.com/COUIMW0 (https://imgur.com/COUIMW0)


https://imgur.com/c8ty8mG (https://imgur.com/c8ty8mG)


Edited by Lynny, 07 July 2020 - 10:38 PM.

Peace,
Lynny

#320 CameronMcGehee

CameronMcGehee

    Hobbyist

  • Members
  • PipPip
  • 15 posts

  • Flag: United States of America

  • Favorite Pinball: Taxi

  • PS3 Gamer Tag: Dont have a PS3
  • 360 Gamer Tag: Dont have a 360

Posted 08 July 2020 - 02:06 AM

Will this new software have support for fastflips? Would like to not have flipper lag like on some VPX tables out there, even if it's just 10-14ms. You would be surprised how much of a difference 10ms vs 1-3ms makes when paired up to a monitor that already has 10ms+ of lag...

 

EDIT: Now that i think of it, what about automatically installed, as in no script modifications needed. That would be nice.


Edited by CameronMcGehee, 08 July 2020 - 02:09 AM.