Adam's Lair Forum

game development and casual madness
It is currently 2020/02/25, 05:51

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: 2014/02/03, 02:08 
Junior Member
Junior Member
User avatar

Joined: 2014/01/20, 04:07
Posts: 26
Role: Hobbyist
I did it! I finished a game. I started not even two weeks ago with the goal of making a simple game, but one still diverse and complicated enough that I would be forced to learn a lot about gamedev, Duality, and C#. In my opinion I exceeded that goal. Here are thoughts, lessons, questions, etc.

Sorry for the length! It's just, this is my first finished project, and I hope it will be helpful to give Adam (and others) all sorts of thoughts and info. I can be a bit verbose at times, but I hope it's valuable to those that read it.

Here is are downloads for the game:

Game only ~8mb (15mb uncompressed)

Game with source and editor ~23mb (66mb uncompressed)



I hope, if nothing else, this game can stand as an example of a noob-output game. Something others can use to learn from.


Background Info
For the record: I do come from a computer science background. And over the past 10 years I have from time to time played with gamedev. Perhaps with GameMaker, or PyGame, or Flashpunk, and even a small dabble with Unity. But I stopped studying cs for the last few years to focus on film making, art, and writing/poetry. This year I decided to bring all these skills together, code and aesthetics, to create games. I think I made the right choice, and I am glad to have found Duality (via /r/gamedev) as it has made for a practical transition.

Let me just say, I really like Duality. I like the philosophy behind it, how minimal things are, and that in the end it really works and doesn't make life a bitch. I am very much interested in rapid development, and Duality allows for this. And I don't just want to do rapid prototypes, but entirely finished games. I need to be making a lot of different things to learn a lot of diverse skills. I think Duality is going to let me do that.

One thing I know: I am going to have to learn how to extend it, and probably even learn how to build it/modify the source. Shaders? Particles? Networking? All things that I assume can be imported via C#/outside libs, but I'll have to learn. This is one goal for the future. Maybe even future resources on this (Duality and the Outside World/Extending Duality) would be helpful.


Workflow / Editor Thoughts
I do not yet have many thoughts on how to improve the workflow of using Dualitor/VSC#/etc. But here are some thoughts that may or may not be justifiable:

- Forgetting that I am running/left running the sandbox while coding, and then building code. I feel like this has, sometimes, caused Dualitor to bug out (fixing by reset), or maybe even corrupting stuff? I cannot confirm this, but maybe worth stress testing? If there are instances of this, maybe there should be some communication between Dualitor and VS? I'd be willing to stress test this.

- A "Make Release" feature? Personally, I plan to offer two versions of my games: The Game (just the game), and The Game-Source (which includes the code and editor). But right now I have to do this by hand, following this guide. It'd be great if Dualitor could make a copy of the necessary files and output either one of these options. I would definitely use this!

- When a game object is cloned, maybe have the option to auto-add a number to the object name? This is something I did at one point (lots of cloning), because I had yet to fully understand the power/convenience of Prefabs/enumerators/creating-objects-dynamically. SO, I don't actually know if this is needed. But sometimes I do like to number things. I guess if I wanted 20 unique objects, name pattern GameObject1-20, I'd rather Duality name them this than me, even if I still had to by hand modify individual properties (using a mouse). Also note: clicking "Tab" while renaming a GameObject does not go to the next object to rename it (a standard Windows convention). Even this may have saved me some time!


Lessons

- Learn how to use prefabs!! And then learn how to use enumerators! Chances are at some point you will have a game feature idea that would benefit from this knowledge. There are examples of Adam doing this in the example duality games. And now in my game above there are examples where I did and did not use them, and the differences are clear.


Programming Related Questions / Bugs(?)


1. Renaming DualityLauncher.exe : When I made my versions of the game to be download-ready, I copy-pasted DualityLauncher.exe and made a file called Memory(self-related).exe. This is the name of my game, and I thought would be more convenient for users if they saw this (this has already proven true for my gf). It ran on my system, and my laptop, so I didn't question it. But my friend had problems running it. He was getting errors in his logfile. It turns out, so was I! But my game worked. Regardless, telling him to use DualityLauncher.exe let him run the game correctly. So, how can somebody correctly rename the Launcher to fit their game name/etc? I see Select Launcher, no idea how to use it. I can deump the logfile (my friend emailed to me) if needed.

2. Unused Variables, trouble deleting : If a top level (in the component, not in a function) private variable is created, the code built, and then then variable removed, and the code built, then the logview throws warnings. So I have just been leaving in unused variables, because I feel more comfortable about VS warning me about those than Duality. But can these unused variables be gotten rid of? See PlayerControl_1 for an example of unused variables that I'd get rid of if Duality didn't scare me.

3. Watching keyboard input, best method? : In a lot of your examples, you use this "DualityApp.Keyboard.KeyDown = this.Keyboard_KeyDown;" system for watching key commands (using custom functions, e.key, etc). In your github/wiki example you use a more basic system, which exists in OnUpdate and watched DualityApp.Keyboard[...]. What are the pros cons of each? Or that is, why do you in your game demos use this other method? I will probably play with it, but figured I'd ask.

4. Hiding something from reality : In my game, in at least one instance, I created the GameObject, but for a phase/mode of the scene I needed the object to be Invisible and non-collideable. So, I could set VisibilityGroups in code. But I could not set CollidesWith. How can one access CoillidesWith and CollisionGroup bitmasks Category? I even looked in Duality source, found where Category is defined, but I could not trick VS no matter what I did. I bet I could build a special Duality to make something public/etc. a) I don't know how to do this. b) Is there a reason Category is unaccessable or c) what did I do wrong? Think I just moved the object to an absurd Pos, to remove collision potential.

5. Crash on scene change, due to object null etc : What is the proper way to setup everything to avoid Scene change memory/reference crashes? Obviously one must be careful the way they setup their code, especially with OnUpdate functions. But I am wondering if you could provide some thoughts or guidance (or point to a guide) on how to best avoid the crash on scene change from the OnUpdate function. I can expand if needed. For example, I HAD to add a line to remove a game component in Inspector_3, because without it the game would crash from Scene3 to Scene4_1.






Okay, that will do for now. Sorry for the length, but it was this or a million threads all over.

Feedback is welcome on the game, but at the moment I'd rather focus on Duality discussion, since that is more important and relevant to this forum.

Of course, Adam feel free to use my code as examples of what to do or (more likely) what NOT to do, etc. I want to learn.

Thanks adam and friends. I'm going to consume some movies/books/etc for the next week, and then it's back to gamedev! But I'll be on here.


Last edited by charles on 2014/02/03, 03:53, edited 1 time in total.

Top
 Profile  
 
PostPosted: 2014/02/03, 02:55 
Member
Member
User avatar

Joined: 2014/01/25, 21:14
Posts: 52
Role: Hobbyist
Hey man, I played your game and read through your post!

Obviously, lots of the questions are aimed more at Adam than anyone else (simply because most questions are about the inner workings of Duality), but I'll just chime in with the knowledge I have up to now.

First, your DualityGame.exe issue. The simplest way to do this is to simply make a shortcut to the DualityGame and give it a different name :).

Second, for the hiding from reality. I'd simply not make it hard on yourself and just make a new prefab or disable the rigidbody and spriterenderer components of the object. I'm not sure if I understood your question correctly, but that's it I think.

Now about the game itself.
I have no idea what in gods name I need to do haha. I got out of the first room, then you go into a maze. I found a dude who looks at you all the time, but I couldn't get to him. I did get to all sides of him, but I was unable to find a hole. Maybe a way of showing the way via the background objects would be a good idea. For instance, trees pointing in the direction you should go to or something like that.
I can't find anything else wrong with it up to now, it controls pretty nicely and all that, so good job!

One last thing though: I think this should be in the "Projects" sub-forum of this board xD


Top
 Profile  
 
PostPosted: 2014/02/03, 03:43 
Junior Member
Junior Member
User avatar

Joined: 2014/01/20, 04:07
Posts: 26
Role: Hobbyist
Thanks for playing!!

I agree about the "hiding from reality" solution. I guess I still wanted to point out that that property was not accessible via code, but is accessible in Dualitor, so maybe not intuitive??


As far as the maze: I am quickly learning from my friends that the maze is too hard. And now you too! I am making it easier as we speak. I am removing a lot of the walls, multiple paths to him, etc. I promise the game is sooo much easier after him. Poor design choice on my part. SO SORRY!!! And the game is not even that long after that! lol..

I will let everybody know when I upload that (very shortly here).


Also, I am totally fine with this being moved anywhere. I did it here cause somebody looking for misc programming help may find it useful. But whatever!


Top
 Profile  
 
PostPosted: 2014/02/03, 03:55 
Junior Member
Junior Member
User avatar

Joined: 2014/01/20, 04:07
Posts: 26
Role: Hobbyist
Updated the download for the game, with the much easier to play maze (I hope!!!) (I updated the links in the opening post, as well)

The game should only take maybe 20 minutes to play.


Game only ~8mb (15mb uncompressed)

Game with source and editor ~23mb (66mb uncompressed)



Thanks if you play. Feedback welcome.


Top
 Profile  
 
PostPosted: 2014/02/03, 03:58 
Member
Member
User avatar

Joined: 2014/01/25, 21:14
Posts: 52
Role: Hobbyist
Worry not!
I'll play it again after the adjustments :).

The 2 properties are accessible via code by the way, I'm not sure if it's the best way, but it works for me:
Code:
SpriteRenderer renderer = this.GameObj.GetComponent<SpriteRenderer>();
renderer.Active = false;


Good luck!


Top
 Profile  
 
PostPosted: 2014/02/03, 04:11 
Member
Member
User avatar

Joined: 2014/01/25, 21:14
Posts: 52
Role: Hobbyist
So I just played through the thing. It was pretty interesting, but I sort of missed the climax at the end. What happened to the girl? What is she going to do? I might've been lost in all the words though haha :P.


Top
 Profile  
 
PostPosted: 2014/02/03, 15:09 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Congratulations on completing your game :) It's actually the hardest part; most hobbyists don't make it that far.

Let's go over your experiences with Duality first:

charles wrote:
- Forgetting that I am running/left running the sandbox while coding, and then building code. I feel like this has, sometimes, caused Dualitor to bug out (fixing by reset), or maybe even corrupting stuff? I cannot confirm this, but maybe worth stress testing? If there are instances of this, maybe there should be some communication between Dualitor and VS? I'd be willing to stress test this.


Reloading Plugins while the Sandbox is running is a lot more error-prone than doing so without the game running, yet it is supported as well. If you run into problems there, some logs and sample code for reproducing the issue would be great :) It should work in general, though.

charles wrote:
- A "Make Release" feature? Personally, I plan to offer two versions of my games: The Game (just the game), and The Game-Source (which includes the code and editor). But right now I have to do this by hand, following this guide. It'd be great if Dualitor could make a copy of the necessary files and output either one of these options. I would definitely use this!


Yep, that'd be great. You're the first one to actually bring it up, though. You can find an already opened issue here, but I simply didn't get around to this yet.

charles wrote:
- When a game object is cloned, maybe have the option to auto-add a number to the object name? This is something I did at one point (lots of cloning), because I had yet to fully understand the power/convenience of Prefabs/enumerators/creating-objects-dynamically. SO, I don't actually know if this is needed. But sometimes I do like to number things. I guess if I wanted 20 unique objects, name pattern GameObject1-20, I'd rather Duality name them this than me, even if I still had to by hand modify individual properties (using a mouse). Also note: clicking "Tab" while renaming a GameObject does not go to the next object to rename it (a standard Windows convention). Even this may have saved me some time!


Noted. This could be easily done via editor plugin by defining a new EditorAction, which will show up in a GameObjects right-click menu and could allow mass-cloning it following certain rules, e.g. renaming, offset, etc. Just an idea, though.

charles wrote:
1. Renaming DualityLauncher.exe : When I made my versions of the game to be download-ready, I copy-pasted DualityLauncher.exe and made a file called Memory(self-related).exe. This is the name of my game, and I thought would be more convenient for users if they saw this (this has already proven true for my gf). It ran on my system, and my laptop, so I didn't question it. But my friend had problems running it. He was getting errors in his logfile. It turns out, so was I! But my game worked. Regardless, telling him to use DualityLauncher.exe let him run the game correctly. So, how can somebody correctly rename the Launcher to fit their game name/etc? I see Select Launcher, no idea how to use it. I can deump the logfile (my friend emailed to me) if needed.


I'm actually doing this in one of my projects, yet I didn't receive any error messages and couldn't reproduce the issue when renaming your game launcher file. However, when working in the editor, you'll need to let it know about your new launcher file, or it won't let you start or debug your game. You can do so by using Run / Select Launcher....

Again, since I can't reproduce this behavior, more information and a solid test case would be appreciated. As a workaround, the shortcut solution doesn't sound too bad.

charles wrote:
2. Unused Variables, trouble deleting : If a top level (in the component, not in a function) private variable is created, the code built, and then then variable removed, and the code built, then the logview throws warnings. So I have just been leaving in unused variables, because I feel more comfortable about VS warning me about those than Duality. But can these unused variables be gotten rid of? See PlayerControl_1 for an example of unused variables that I'd get rid of if Duality didn't scare me.


Quote:
So I have just been leaving in unused variables, because I feel more comfortable about VS warning me about those than Duality.


Haha :D Well, at least someone is paying attention to the logs. This is good to hear. Although it's deceived you in this case, because these specific warnings are harmless and will go away as soon as you (modify and) save the affected files again. It's simply a quick note from the serialization module that lets you know about the fact that it has just loaded a file which contained more information than it actually used for constructing objects, i.e. your removed variables. I should probably remove those warnings.

charles wrote:
3. Watching keyboard input, best method? : In a lot of your examples, you use this "DualityApp.Keyboard.KeyDown = this.Keyboard_KeyDown;" system for watching key commands (using custom functions, e.key, etc). In your github/wiki example you use a more basic system, which exists in OnUpdate and watched DualityApp.Keyboard[...]. What are the pros cons of each? Or that is, why do you in your game demos use this other method? I will probably play with it, but figured I'd ask.


The old demos simply use the events, because the method-based system wasn't developed the way it is now. There is no definite pro or con for one of the input API parts except your personal preference. I usually go with just calling methods and not using events, because every callback that is registered will need to be unregistered later manually, whereas calling a method to check if a key was hit is a fire-and-forget action.

These are functionally equivalents for determining whether a key has been hit, i.e. performing a one-time reaction:
Code:
DualityApp.Keyboard.KeyDown += ...

Code:
if (DualityApp.Keyboard.KeyHit(Key.Escape))


And these are equivalent for performing an as-long-as-pressed-action:
Code:
if (DualityApp.Keyboard.KeyPressed(Key.Escape))

Code:
if (DualityApp.Keyboard[Key.Escape])


charles wrote:
4. Hiding something from reality : In my game, in at least one instance, I created the GameObject, but for a phase/mode of the scene I needed the object to be Invisible and non-collideable. So, I could set VisibilityGroups in code. But I could not set CollidesWith. How can one access CoillidesWith and CollisionGroup bitmasks Category? I even looked in Duality source, found where Category is defined, but I could not trick VS no matter what I did. I bet I could build a special Duality to make something public/etc. a) I don't know how to do this. b) Is there a reason Category is unaccessable or c) what did I do wrong? Think I just moved the object to an absurd Pos, to remove collision potential.


Actually, it's pretty simple. Like Ekibyou said, you can deactivate Components and GameObjects by setting their Active Property to false. :) It's also what the editor does internally when you click on that checkbox near a Component

charles wrote:
5. Crash on scene change, due to object null etc : What is the proper way to setup everything to avoid Scene change memory/reference crashes? Obviously one must be careful the way they setup their code, especially with OnUpdate functions. But I am wondering if you could provide some thoughts or guidance (or point to a guide) on how to best avoid the crash on scene change from the OnUpdate function. I can expand if needed. For example, I HAD to add a line to remove a game component in Inspector_3, because without it the game would crash from Scene3 to Scene4_1.


Usually, the following should be okay:

Code:
Scene.Current.Dispose();
Scene.Current = your Scene;


When you're operating from within an OnUpdate method, this can yield some unexpected results, though. Keep in mind that the object you are currently updating is part of the Scene that you are ordering to be disposed, so.. although it works fine in a lot of cases, this may have unfortunate side-effects depending on your own source code. It's impossible to make a global statement, but to be absolutely safe, you can just schedule the Scene switch in your CorePlugin class and perform it in a custom OnAfterUpdate override.

I should probably introduce some kind of SafeSwitch method. Thanks for bringing this up :)


Now, to your game. I've played it through and must say, I did not expect something like this. Really liked it. Yeah, it may not be entirely polished, and it's one of those which you can hardly call "game", but still - there's some artistic touch to it that makes it special, and this is something I'd love to see embraced more often. I think, I didn't quite "get" the story, but its overall presentation and structure makes it seem like this is in fact not a bad thing, but rather a challenge to understand what this is all about. The texts are beautiful and intriguing. Also, the "breaking the tile grid" twist made me smile.

Thumbs up. I certainly hope, this wasn't your last creation.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2014/02/04, 05:08 
Junior Member
Junior Member
User avatar

Joined: 2014/01/20, 04:07
Posts: 26
Role: Hobbyist
Ekibyou wrote:
So I just played through the thing. It was pretty interesting, but I sort of missed the climax at the end. What happened to the girl? What is she going to do? I might've been lost in all the words though haha :P.


Thanks so much for playing, Ekibyou! Both for the feedback initially, and for giving it a second try after the fix.

Yeah, the ending of the game is weird. But "What is she going to do?" Well, what do any of us do when we step out of the familiar and into the open, into the void? I guess we don't know what to do. But it sure is exciting! Maybe she feels the same way too. Or maybe she'll follow the breadcrumbs back to a safe haven, like so many of us do. Who knows!

But do keep in mind, this project, like most of my near upcoming stuff, are just experiments to teach myself gamedev, techniques, and Duality. So while I did put thought and care into the game, I also just needed to finish it. The concept itself could be explored so much more heavily, deeply, and artfully. But I just needed to finish it and move on. Maybe sometime later this year I will venture into a larger project, something deserving of more than 2 weeks (not even) of development.

Again, thanks for playing!


Top
 Profile  
 
PostPosted: 2014/02/04, 05:22 
Junior Member
Junior Member
User avatar

Joined: 2014/01/20, 04:07
Posts: 26
Role: Hobbyist
Quote:
Reloading Plugins while the Sandbox is running [...] If you run into problems there, some logs and sample code for reproducing the issue would be great :) It should work in general, though.


I will be sure to do that, if it happens again.

Quote:
You can find an already opened issue


Looks great! Good suggestions in there. I need to start playing with github, and perhaps "opening issues." Any basic guidelines on when we should do this? Just curious, since I'm new to it.

Quote:
This could be easily done via editor plugin by defining a new EditorAction, which will show up in a GameObjects right-click menu and could allow mass-cloning it following certain rules, e.g. renaming, offset, etc. Just an idea, though.


Woah didn't know anything about being able to do that. I guess I knew that stuff was possible, but it has yet to cross my mind. I will definitely play with this, and consider it's uses in my future projects. Awesome!

Quote:
Again, since I can't reproduce this behavior, more information and a solid test case would be appreciated. As a workaround, the shortcut solution doesn't sound too bad.


Yeah, I could not get my game to not run either. It was just him. I won't worry about it for now, and hopefully in the future we'll have a Deploy feature.

Quote:
because these specific warnings are harmless and will go away as soon as you (modify and) save the affected files again


Interesting. Okay, I will try that the next time it inevitably happens. Maybe just a note in the error log about this? I dunno. It's good to have errors/warnings, but also good to know how to ignore/move on from them.

Quote:
The old demos simply use the events, because the method-based system wasn't developed the way it is now.


Okay, good to know. I have noticed the differences at times when learning from your examples. Thanks for the clarification.

Quote:
you can deactivate Components and GameObjects by setting their Active Property to false.


Hmm, okay. For some reason I chose not to try this I guess. Thanks.

Quote:
I should probably introduce some kind of SafeSwitch method. Thanks for bringing this up


I will just keep learning how to best set things up to avoid this. And I always figured out how to fix the issues. But they do, sometimes, sneak up on me. If you can figure out a cool safety solution then I'd definitely check it out.

Quote:
Now, to your game. I've played it through and must say, I did not expect something like this. Really liked it. Yeah, it may not be entirely polished, and it's one of those which you can hardly call "game", but still - there's some artistic touch to it that makes it special, and this is something I'd love to see embraced more often. I think, I didn't quite "get" the story, but its overall presentation and structure makes it seem like this is in fact not a bad thing, but rather a challenge to understand what this is all about. The texts are beautiful and intriguing. Also, the "breaking the tile grid" twist made me smile.

Thumbs up. I certainly hope, this wasn't your last creation.


Thanks for the kind and honest words, and for taking the time to play it! Was only possible in so short a time because of your engine and your help on this message board (and even some of your code :P)

I definitely can be Mr. "Artsy" Fartsy. Just how I am and how I'm influenced. But I want to try making lots of different kinds of games. Learn about me and what I like to make.

Definitely not my last, with Duality or any engine. Just getting started!

Thanks for all the help and patience.


Top
 Profile  
 
PostPosted: 2014/02/04, 11:01 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
charles wrote:
Looks great! Good suggestions in there. I need to start playing with github, and perhaps "opening issues." Any basic guidelines on when we should do this? Just curious, since I'm new to it.


Whenever you are so sure about your feature request or bug report that you don't require any discussion or information from me or other developers to report it. This usually happens when you've figured something out by yourself and just want to inform me about it.

Quote:
Definitely not my last, with Duality or any engine. Just getting started!


Looking forward to it :)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group