Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1058963 Posts in 43038 Topics- by 34985 Members - Latest Member: DevilBliss

October 30, 2014, 05:42:47 AM
TIGSource ForumsFeedbackDevLogsProject Rain World
Pages: 1 ... 71 72 [73] 74 75 ... 116
Print
Author Topic: Project Rain World  (Read 212989 times)
JLJac
Level 10
*****



View Profile
« Reply #1440 on: March 24, 2014, 08:51:10 AM »

Haha! Ok, so FSM is mostly useful when you have exponential stuff like transition states between all the other states and the like?

Update 224
Converting code! Moved a fat chunk of the player behaviour from the old game to the new one today. Still not entirely there, but it's looking more like it. Tomorrow I'll be able to run around and jump on platforms, I think!

Some of this code is so horrible to look at you wouldn't even believe it. Almost all of it is old enough to have moss and fungi growing all over it, for most chunks I have to think long and hard about what they're actually supposed to do. All of it is just one giant, multi-headed beast of nested if statements. Some pieces sit around doing nothing at all, seemingly, I leave a note at those.

Some code looks weird and useless, and but when I run without it there is some bug, and if I introduce it, the bug goes away. In one spot I've even left a comment "I don't remember how this code works, but it prevents this and that problem. So let it be!" Thankfully that's an exception though, otherwise I've been able to figure out what the code is doing after a little bit of tinkering.

In either case, I'm always thankful when I stumble upon some strange looking solution and implement it, and it immediately works. It's so long ago I don't really remember it, but I can imagine I spent several days in frustration trying to find those solutions, and now I'm really happy to get them for free!
Logged
Vanhail
Level 0
**



View Profile
« Reply #1441 on: March 24, 2014, 10:50:55 AM »

Hahaha, oh man, I've been there. Keep up the good work.
Logged

JLJac
Level 10
*****



View Profile
« Reply #1442 on: March 26, 2014, 11:09:26 PM »

Update 225
Trudging along... Don't get me wrong, I'm having a wonderful time, but my ambition to divide the work into manageable chunks is down the drain. My idea was to first convert the player - but in order to work on the player's movement behaviors I need to be able to save and load a level, and in order for that to happen I need to understand how to handle XML and text files, etc etc etc.



The biggest convertion push for the player is done though, ie basic terrain interaction. Still have all the behaviors involving poles, and a few other special cases left.


Throwing a few questions out there:

Currently I'm researching on saving and loading a level from a text file, any general tips on that?

Right now my tiles (all the little things that populate the 2d array of a room) are classes. Should I go with structs instead?

If I fetch one property of a struct, and it has other, big, properties, does it pass its heavy value-based self through all the methods used to fetch it?
Example:
Code:
public struct MyStruct()
{
public bool verySmallProp;
public int[,,,,,,] SUPERBIGPROP;
}

if (object.anotherObject.thirdObject.fetchMyStruct().verySmallProp){//...}
Is the data of SUPERBIGPROP unnecessarily passed as well, slowing everything down? In that case, would a class be quicker? (Which is, to my understanding, reference based and thus not passed at all)
I'm asking because every object is asking the surrounding tiles about their status many many times per frame, so I want that to run as smoothly as possible.

A tile can have several things on it, such as poles vertically and horizontally, fly hives, etc etc etc. How would you guys store that information? A lot of bools, or a list with tags?
Logged
RealityShifter
Level 0
***



View Profile WWW Email
« Reply #1443 on: March 27, 2014, 12:16:41 AM »

I had success saving room data in .ini files. All the tiles then the objects. The file sizes are surprisingly small. XML files work similarly and I think that's the standard.

I don't think weather you use structs or classes matters, or even the filing method. Just that the data is well kept track of, and can be interpreted. Your making a level compiler / decompiler! good luck.

How I've done it is had all possible variables to be saved fed into the file regardless of being null or 0. so my tiles have 6 variables total possible. So in the ini file there's always 6 lines per tile and each line corresponds to a variable in the same order each time x,y, etc. When I'm feeding the level data back into the game to be played, the decompiler script assigns those variables to a created tile in the same order, and knows a new tile starts every 6 lines. It's like bytes! :D

It looks like this.
5=176.000000
4=32.000000
3=3.000000
2=0.000000
1=0.000000
0=0.000000

.ini files work well with easily separating your tiles from objects because you can assign and look up sections.
Logged

Creativegametheory.com
@theorygeorgiou
JLJac
Level 10
*****



View Profile
« Reply #1444 on: March 27, 2014, 12:52:48 AM »

Wow, that looks high tech  Shocked
I just solved it actually, using IFormatter and FileStream - I got the solution from the c# documentation. And yeah, the levels are totally small! With this solution you just have to mark the classes involved in the serialization as [Serializable] and then it just magically takes care of everything :D It packages the instances(in my case of the Tile class) somehow and stores them in the file, and then it unpacks them into living instances just as easily. And yeah, the file size is super small!

But I'm pretty sure it would be even smaller if I did it your way... Well, this wasn't what I was supposed to be doing anyway - I was supposed to tweak the wall gliding, and was fed up with having to rebuild a wall to glide against each time I changed something haha!
Logged
NicoM
Level 0
**


View Profile Email
« Reply #1445 on: March 27, 2014, 08:59:47 AM »

How are you handling collision resolution in rain world?
Logged
RealityShifter
Level 0
***



View Profile WWW Email
« Reply #1446 on: March 27, 2014, 09:49:32 AM »

Awesome. yep it is easier than it sounds. ha ha.
Logged

Creativegametheory.com
@theorygeorgiou
Zaphos
Level 5
*****



View Profile WWW Email
« Reply #1447 on: March 27, 2014, 10:12:26 AM »

Wow, that looks high tech  Shocked
I just solved it actually, using IFormatter and FileStream - I got the solution from the c# documentation. And yeah, the levels are totally small! With this solution you just have to mark the classes involved in the serialization as [Serializable] and then it just magically takes care of everything :D It packages the instances(in my case of the Tile class) somehow and stores them in the file, and then it unpacks them into living instances just as easily. And yeah, the file size is super small!

But I'm pretty sure it would be even smaller if I did it your way... Well, this wasn't what I was supposed to be doing anyway - I was supposed to tweak the wall gliding, and was fed up with having to rebuild a wall to glide against each time I changed something haha!
If it's serializing to binary files then that's probably smaller than an ini file would be.

One thing to watch out for with automatic serialization is making sure that your saves are compatible across versions of your game -- i.e. if you add or remove fields, or change the names of fields, you still want to be able to load files that were created with the old code.  These docs might help with that: http://msdn.microsoft.com/en-us/library/ms229752(v=vs.110).aspx (disclaimer: I have not used C# with Unity so I don't know for sure)
Logged

NicoM
Level 0
**


View Profile Email
« Reply #1448 on: March 27, 2014, 06:08:53 PM »

Quote
These docs might help with that: http://msdn.microsoft.com/en-us/library/ms229752(v=vs.110).aspx (disclaimer: I have not used C# with Unity so I don't know for sure)
very interesting link, I hadn't seen that one, I guess I figured it was impossible, or at least you would have to load them in as the old type and then convert them yourself, but I guess not:)
Logged
RainWorldIsAwesome
Level 0
**


View Profile Email
« Reply #1449 on: March 27, 2014, 06:50:03 PM »

Are you ever gonna release the version that was Coded in lingo?
Logged
Christian
Level 7
**



View Profile WWW Email
« Reply #1450 on: March 27, 2014, 08:32:24 PM »

Are you ever gonna release the version that was Coded in lingo?
This would be awesome if it happened
Logged

Visit Indie Game Enthusiast or follow me @IG_Enthusiast to learn about the best new and upcoming indie games!
devMidgard
Level 0
***



View Profile Email
« Reply #1451 on: March 28, 2014, 02:01:14 AM »

Update 225
Trudging along... Don't get me wrong, I'm having a wonderful time, but my ambition to divide the work into manageable chunks is down the drain. My idea was to first convert the player - but in order to work on the player's movement behaviors I need to be able to save and load a level, and in order for that to happen I need to understand how to handle XML and text files, etc etc etc.



The biggest convertion push for the player is done though, ie basic terrain interaction. Still have all the behaviors involving poles, and a few other special cases left.


Throwing a few questions out there:

Currently I'm researching on saving and loading a level from a text file, any general tips on that?

Right now my tiles (all the little things that populate the 2d array of a room) are classes. Should I go with structs instead?

If I fetch one property of a struct, and it has other, big, properties, does it pass its heavy value-based self through all the methods used to fetch it?
Example:
Code:
public struct MyStruct()
{
public bool verySmallProp;
public int[,,,,,,] SUPERBIGPROP;
}

if (object.anotherObject.thirdObject.fetchMyStruct().verySmallProp){//...}
Is the data of SUPERBIGPROP unnecessarily passed as well, slowing everything down? In that case, would a class be quicker? (Which is, to my understanding, reference based and thus not passed at all)
I'm asking because every object is asking the surrounding tiles about their status many many times per frame, so I want that to run as smoothly as possible.

A tile can have several things on it, such as poles vertically and horizontally, fly hives, etc etc etc. How would you guys store that information? A lot of bools, or a list with tags?

I see you're developing this in C#, are you using a custom built engine or Unity, or somewhat popular?

-- EDIT

Actually yeah, I could also go back some pages and see the UnityEngine included into a Script, so no need to respond me :D

Good freaking luck around that, this game looks awesome.
Logged
electrolyte
Level 2
**



View Profile
« Reply #1452 on: March 28, 2014, 08:32:37 AM »

I'm super impressed at your jump from Lingo to Unity  Smiley
Following this like a rash!
Logged

JLJac
Level 10
*****



View Profile
« Reply #1453 on: March 29, 2014, 02:58:21 PM »

Thanks everyone!

Collision is all home brewn code, like everything else in the game except sprite handling, where I use the excellent Futile framework. It's strictly tile based for terrain and radius/trigonometry based for creatures, simple as that.

Yeah, I know I need to watch out for backwards conmability... Ran into that issue a few times with the old level editor. This time around I don't think it'll be as big of a problem though, as the game will not evolve as much during the process since it's already designed.
Logged
Slader16
Level 6
*



View Profile Email
« Reply #1454 on: March 29, 2014, 03:01:12 PM »

How are you making the player sway?

I think that's the right word  Shrug

*Edit*
Oh, and are you using Unity's 2D or 3D mode?
« Last Edit: March 29, 2014, 03:57:16 PM by Slader16 » Logged

NicoM
Level 0
**


View Profile Email
« Reply #1455 on: March 29, 2014, 03:23:55 PM »

Is the tile collision done so that the player is pushed out after moving, or not allowed to enter the tile ever (sorry about the questions, this is just what ive been working out in my attempt at an engine...)
Logged
prime31
Level 0
*


View Profile Email
« Reply #1456 on: March 30, 2014, 09:44:28 AM »

@Slader16, there is no such thing as "2D" vs "3D" mode for Unity. Everything is 3D. Even a flat quad consists of four three-dimensional points of all which have the same z value.
Logged
Slader16
Level 6
*



View Profile Email
« Reply #1457 on: March 30, 2014, 10:18:11 AM »

@Slader16, there is no such thing as "2D" vs "3D" mode for Unity. Everything is 3D. Even a flat quad consists of four three-dimensional points of all which have the same z value.
Oh yeah, you're right!

(I keep forgetting that Facepalm)
Logged

NicoM
Level 0
**


View Profile Email
« Reply #1458 on: March 30, 2014, 10:23:25 AM »

@Slader16, there is no such thing as "2D" vs "3D" mode for Unity. Everything is 3D. Even a flat quad consists of four three-dimensional points of all which have the same z value.
Oh yeah, you're right!

(I keep forgetting that Facepalm)

he's using futile, which as I understand it, only uses unity for rendering, and is mainly code based, acting much more like flash (I haven't used it, so correct me if I'm wrong)
Logged
Slader16
Level 6
*



View Profile Email
« Reply #1459 on: March 30, 2014, 10:41:23 AM »

@Slader16, there is no such thing as "2D" vs "3D" mode for Unity. Everything is 3D. Even a flat quad consists of four three-dimensional points of all which have the same z value.
Oh yeah, you're right!

(I keep forgetting that Facepalm)

he's using futile, which as I understand it, only uses unity for rendering, and is mainly code based, acting much more like flash (I haven't used it, so correct me if I'm wrong)
Ohh, I thought that Futile was for rendering the sprites/animations etc.
Logged

Pages: 1 ... 71 72 [73] 74 75 ... 116
Print
Jump to:  

Theme orange-lt created by panic