playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - krmko

Pages: 1 2 3 [4] 5 6 ... 67
46
PlayMaker Help / Re: Playmaker's general rule
« on: December 25, 2019, 01:45:04 PM »
Put finished and let the last state send the event to controller fsm which will disable it?

47
PlayMaker Help / Re: Late binding sprite atlas sprites
« on: December 24, 2019, 03:10:05 AM »
I included only one atlas in the build, the one necessary for the main menu and the first level. The other atlases (atlas for level 2, level 3 and so on) are NOT included in the build and i use resources.load to load them when they are needed so i can cut down my initial loading time. I have 500mb of textures which i can split into multiple parts so i need to load only 100mb on game start instead of 500mb and load the rest as needed in cutscenes between levels.

The thing is, loading the sprite atlas resource is not enough. You may load the sprite atlas as a resource on runtime, but it will do nothing, sprites will have white squares instead of texture.

So, this is what the sprite atlas API tells:

If ‘Include in Build’ is disabled, Unity still packs the Sprite Atlas into a *.spriteatlas file in the Project’s Assets folder. However, Sprites which reference Textures in an disabled Sprite Atlas appear invisible as the reference Texture is not available or loaded. Unity does not include the disabled Sprite Atlas in the Project’s published build, and does not automatically load it at run time. To do so, a script is required to load the Sprite Atlas via Late Binding.

Late Binding is the name of a process in which you load or swap in the desired Sprite Atlas at run time via the Sprite Atlas API. This is necessary when the build does not automatically load a prepared Sprite Atlas at run time (for example, when no Sprite Atlases are included in the build.)

So, actually, the sprite atlas loaded using resources.load is just a reference list that needs to be populated using Late Binding:

To retrieve the contents of a Sprite Atlas at run time, follow these steps:

Create a custom component that takes SpriteAtlasas a public variable.
Assign a Sprite Atlas to the field.
Enter the Editor’s Play Mode.
Access the variable and call the property .GetSprites to retrieve the array of Sprites packed in the selected Atlas.


I don't know the inner workings of Sprite Atlas, but i guess the included in the build Atlas makes a fixed array that connects references from Sprite Atlas to actual sprites, thus that's why an array has to be made and populated.

Anyway, as i said, resource.load does jackshit without binding, you can try it out yourself. It's quite dumb, i expected that once loaded from resources, it will take care of itself.

48
Action Requests / Re: Compare multiple ints less than/equal/greater than
« on: December 23, 2019, 02:50:49 PM »
Well, you could probably do it without arrays in code. I'm curious, why wouldn't you use an array?

49
PlayMaker Help / Re: Error Loading Action - Index was out of range
« on: December 23, 2019, 06:20:20 AM »
Ok, submitted  ;)

50
I'm having issues with some timers that use wait and countdown timer, when FPS is not capped they seem to finish a lot earlier.

But yeah, i believe that it's unity capping the cpu to keep the framerate in check, but the thing is, when used via script with vsync disabled it does not create overhead. When used via action with vsync disabled then it does.

51
PlayMaker Help / Re: Late binding sprite atlas sprites
« on: December 23, 2019, 04:23:15 AM »
A small addition, i omitted the array script and made an array in the variables and the resized it with Array Resize action to fit the number of sprites from the atlas, but the next step where i have to provide the parameters throws the error i posted.

52
PlayMaker Help / Late binding sprite atlas sprites
« on: December 23, 2019, 03:49:03 AM »
Hello guys,

i started working on a bit of an optimization for my game, so i split my atlas to multiple ones which will be loaded during runtime and not included in build.

I have them loaded using resource.load, but there's something else to be done. This is called Late Binding (https://docs.unity3d.com/Manual/LateBinding.html).

Ok, so i get property from the SpriteAtlas FsmVar (SpriteAtlas.spriteCount) to get the number of sprites.

When i get the number of sprites, i need to create an array of fixed length which will hold all the sprites and fill it with SpriteAtlas.GetSprites (https://docs.unity3d.com/2017.4/Documentation/ScriptReference/U2D.SpriteAtlas.GetSprites.html)

Ok, i made an array variable, as Array Type i set Object, and for Object type i set Sprite.

I made a script with a simple Sprite array and now i have to call the static method UnityEngine.U2D.SpriteAtlas.GetSprites to fill the array. But when i select the Type Array in Call Static Method Action i get:

Error editing field: Parameters
Unknown FsmArray Type: Use ArrayEditorAttribute to specify a VariableType.

Along with this:

Code: [Select]
System.ArrayTypeMismatchException: Unknown FsmArray Type: Use ArrayEditorAttribute to specify a VariableType.
  at HutongGames.PlayMakerEditor.ActionEditor.EditFsmArray (UnityEngine.GUIContent label, System.Object fieldValue, System.Object[] attributes) [0x00071] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:2719
  at HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes) [0x004bb] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1073
  at HutongGames.PlayMakerEditor.ActionEditor.EditFsmVar (UnityEngine.GUIContent label, System.Object fieldValue, System.Object[] attributes) [0x001ed] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1761
  at HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes) [0x001a9] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:934
  at HutongGames.PlayMakerEditor.ActionEditor.EditArray (UnityEngine.GUIContent label, System.Type elementType, System.Array array, System.Object[] attributes) [0x001c8] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1254
  at HutongGames.PlayMakerEditor.ActionEditor.EditArray (UnityEngine.GUIContent label, System.Type elementType, System.Object fieldValue, System.Object[] attributes) [0x00014] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1159
  at HutongGames.PlayMakerEditor.ActionEditor.GUIForFieldTypes (System.String labelText, System.Type type, System.Object fieldValue, System.Object[] attributes) [0x0049d] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:1069
  at HutongGames.PlayMakerEditor.ActionEditor.EditField (System.Object obj, System.Reflection.FieldInfo field, System.String labelText, System.Type fieldType, System.Object fieldValue, System.Object[] attributes) [0x0000c] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Editor\Classes\ActionEditor.cs:582

Any ideas on how should i proceed on this one?

Pictures might be helfpul too.





This is the static method: public int GetSprites(Sprite[] sprites);

53
Hi guys,

i'm using target frame rate action to clamp the frame rate, but there seems to be a lot of overhead every frame. Now i'm not sure how it actually works, does it use the calculated amount of cpu time to actually keep the frame rate in the defined upper limit, or something's just plain wrong. I'm not using Vsync btw, i'm not sure if it's really neccessary, but the action works without it and doesn't push frame rave over defined threshold.

With Target Frame Rate



Without Target Frame Rate



54
PlayMaker Help / Re: Error Loading Action - Index was out of range
« on: December 20, 2019, 11:30:03 AM »
Hey, got the same thing out all of a sudden, don't know what's going on.

Code: [Select]
Error Loading Action: Wait : HutongGames.PlayMaker.Actions.Wait : realTime
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: startIndex

  at System.BitConverter.ToBoolean (System.Byte[] value, System.Int32 startIndex) [0x0003e] in <d7ac571ca2d04b2f981d0d886fa067cf>:0

  at HutongGames.PlayMaker.FsmUtility+BitConverter.ToBoolean (System.Byte[] value, System.Int32 startIndex) [0x00000] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\FsmUtility.cs:832

  at HutongGames.PlayMaker.ActionData.LoadActionField (HutongGames.PlayMaker.Fsm fsm, System.Object obj, System.Reflection.FieldInfo field, System.Int32 paramIndex) [0x00399] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:1107

  at HutongGames.PlayMaker.ActionData.CreateAction (HutongGames.PlayMaker.ActionData+Context context, System.Int32 actionIndex) [0x0024f] in C:\Projects\Playmaker_1.9.1\Projects\Playmaker.source.unity\Assets\PlayMaker\Classes\ActionData.cs:942

It appeared after doing a build.

55
PlayMaker Help / Re: random weight
« on: December 13, 2019, 03:08:19 PM »
Has anyone figured out the dark magic behind.weighted values? I still can't grasp the concept.

56
Share New Actions / Re: UniBulletHell actions
« on: December 10, 2019, 03:09:57 AM »
Hi PlaymakerNOOB,

thanks for playing, playtesting means a lot to me, i'm unable to objectively observe things in my own game anymore.

1. I need to look into it, but it should be enabled via rewired. Is the controller working, but you would just like to remap it?
2. Thanks for that one, i can put some stuff on the loading screen like "you can disable screen shakes/flashes from the menu" and also put it in the menu besides shortcuts.
3. Ah yes, that is a bad one, i need to put the settings inside the game too. I'll put that one on the to do list.
4. To be honest, that's a tough one, i still haven't found the proper way to enable it, multiple inputs with couple of weapons are hard to do properly. For now it will stay like this, but i have to find a solution in the future.
5. Thanks, most of the weapons will have drawbacks.
6. As for level length, level progression is based on invisible variable, experience points. Each enemy gives you a number of XP, when you hit the threshold, boss fight activated. It is one of the mechanisms to make the progression slower or faster depending on the skill. Second level takes double the experience, third double of the second and so on, so you can expect to make a full run in about 30-45 minutes at minimum. Of course, i'll tinker with values probably. Anyway, look at the games like steredenn and such, first levels is always kinda quick, with their downside being that you get to the end of level no matter what, they have fixed number of waves, which i don't like, the focus on RH is on destroying enemies if you want to progress. It's all very hard to balance and make everyone happy. One thing i'm sure about is that i don't want the game to be bullet hell, but widely accessible, yet adaptive in regard to skill level.

As for bosses, the plan is to have 4 variations of each boss so it doesn't get boring, and kind of an ironman/heroic mode for hardcore players which will be VERY HARD since the start.

Once again, thanks for the comments, they mean a lot!

57
Feature Requests / Re: Display Controls as the default
« on: December 10, 2019, 01:54:05 AM »
This one's the bane of my existance. +1.

58
Just open it in any text editor.

59
Share New Actions / Re: UniBulletHell actions
« on: November 30, 2019, 12:04:44 PM »
Great, i'll update them, thanks :)

Pages: 1 2 3 [4] 5 6 ... 67