Adam's Lair Forum

game development and casual madness
It is currently 2020/01/21, 14:12

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: 2015/01/29, 11:12 
Novice Member
Novice Member

Joined: 2015/01/27, 11:47
Posts: 11
Location: Germany
Role: Hobbyist
Thanks guys!

After some tinkering, I am still unsure, if I should switch to duality, I am torn apart :)

Duality is sexy, it's lean. It would be wonderful to get rid of all the baggage. And the people here on this board are nice and helpful.

On the other hand... Id like to have a source for learning, after I finished the available tutorials.

It would just be nice to have something like a manual, a code reference etc. Is there an online code reference for the build-in functions? (I pressed F1 in the editor, but I got no text in the help screen)


Top
 Profile  
 
PostPosted: 2015/01/29, 11:43 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
openend wrote:
It would just be nice to have something like a manual, a code reference etc. Is there an online code reference for the build-in functions? (I pressed F1 in the editor, but I got no text in the help screen)


When you press F1, the editor usually opens the DDoc.chm file in your local Duality folder, which is an offline API documentation of the framework that lists and explains most of the methods and properties.

I think what Duality really needs is a manual, in addition to an API reference. A good place for this would be the existing Wiki Pages, and I've also thought about releasing more example packages - like the space shooter one, but far smaller and more focused. Something like "How to let the Camera follow an object", which you could install, run, look at the source code and play around with it.

There's still a lot of ground to cover and it's a slow process. But we'll get there, eventually :D

openend wrote:
After some tinkering, I am still unsure, if I should switch to duality, I am torn apart :)

Duality is sexy, it's lean. It would be wonderful to get rid of all the baggage. And the people here on this board are nice and helpful.

On the other hand... Id like to have a source for learning, after I finished the available tutorials.


The best learning source right now is practice. Set a small goal, complete a first project - and don't hesitate to ask when you're stuck. :)

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/01/29, 12:54 
Novice Member
Novice Member

Joined: 2015/01/27, 11:47
Posts: 11
Location: Germany
Role: Hobbyist
Yeah, I guess you are right. To avoid frustration I was just used to just read everything I could find upfront.

And I am hesitant to demand something, even tutorials etc. because I know that next to your many hats, creating tutorials (recording cutting writing) and so on is time intensive.

One more Question I have left:
What possibilities do I have for data management ? This was a huge hurdle for me in the past. How would I create a link to excel, xml or something else?

Example: RPG Item Database. Each Item has an associated pic, sprite, values, prices etc.
This data should be editable from outside, and loaded as a ressource at game start.

I probably ask for a lot here, or the answer may be "just use .net build-in functions!" or something else. But there may be a recommended route to go.


Top
 Profile  
 
PostPosted: 2015/01/29, 13:09 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
openend wrote:
One more Question I have left:
What possibilities do I have for data management ? This was a huge hurdle for me in the past. How would I create a link to excel, xml or something else?

Example: RPG Item Database. Each Item has an associated pic, sprite, values, prices etc.
This data should be editable from outside, and loaded as a ressource at game start.

I probably ask for a lot here, or the answer may be "just use .net build-in functions!" or something else. But there may be a recommended route to go.


maybe this? :redface:

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/29, 13:18 
Novice Member
Novice Member

Joined: 2015/01/27, 11:47
Posts: 11
Location: Germany
Role: Hobbyist
Master Pi, I should've known :)

Ill need to test this out. First Look: awesome.

NOTE: I just realized, that my problems with the script reference were caused by the User Account Control. What a newbie mistake :)


Top
 Profile  
 
PostPosted: 2015/01/29, 13:29 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
Quote:
And I am hesitant to demand something, even tutorials etc. because I know that next to your many hats, creating tutorials (recording cutting writing) and so on is time intensive.


Mentioning what's missing for you is valuable feedback and does not necessarily equal demanding stuff. :) But you're right that documentation is a big task and not done in a few hours - that's why I am really grateful for all the third-party resources on learning Duality that have emerged so far. That's just a big load of work off my schedule.

Regarding data management, two options come to my mind: Using .Net or using Duality's Resource system.

  1. Using .Net Functionality

    On the plus side, there's a whole world of ready-to-use solutions out there and you can just open a file, load it and be done with it. Minimal effort! The problem here is that you will be forced to carry all that functionality to the player, external libraries stack up and with them, the potential for obscure crashes and instabilities - because you've introduced some additional "points of failure".

    Also, if you need preprocessing of some sort, loading times might increase, because that preprocessing needs to be done on each startup.

  2. Using Duality Resources

    A solution to this is first importing the raw data, preprocessing it to your needs and saving it in a custom format that serves your specific purpose, requires no external dependencies, and doesn't have the overhead of being a "all in one" solution of which you only use 10%. As a bonus, you get the whole Duality Resource handling for free as well!

    To do this, you will need to define a custom Resource format. Simply derive from Resource like you would derive from Component, and specify fields and properties. You will already be able to create your custom Resource type in the editor, load it and use it like any other Resource.

    Next step: Add the EditorPlugin project to your solution file and implement a custom File Importer that loads an Excel sheet (or whatever you need) and creates or updates your custom Resource format accordingly. You'll find some examples here. Note: Make sure to only recompile your EditorPlugin when you changed something, because editor plugins can't reload at runtime and will restart the editor.

    Final step: Dragdrop your raw source files into the Project View. If you need to update the Resource later, just edit the source file in the Source/Media directory while the editor is open and it will automatically update.

SirePi has done some work on #2 with the plugin he linked, which you could check out. Then there's skoggy who has written something similar for his custom animation system and talking to BraveSirAndrew he mentioned they're importing (Excel?) spreadsheets to create and update Duality Resources. I'd say it isn't that uncommon to go this way. :D

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/01/29, 19:15 
Novice Member
Novice Member

Joined: 2015/01/27, 11:47
Posts: 11
Location: Germany
Role: Hobbyist
Just another quick question. Did I overlook something, or is it not the best idea to cache components in the update cycle? (like in the getting started tutorial)

I feel like I should cache them in a kind of start function, right? Only once. Is the Init() method the right way to do that?

Update: Seems to work, no null exception for my rigidbody component. Only negative thing seems to be that the explicit implementation of OnShutdown clutters my player class :(. Is there a way around it?

Thanks!


Top
 Profile  
 
PostPosted: 2015/01/29, 19:25 
Forum Addict
Forum Addict
User avatar

Joined: 2013/09/19, 14:31
Posts: 883
Location: Italy
Role: Hobbyist
openend wrote:
Just another quick question. Did I overlook something, or is it not the best idea to cache components in the update cycle? (like in the getting started tutorial)

I feel like I should cache them in a kind of start function, right? Only once. Is the Init() method the right way to do that?

Thanks!


Depends.. if you are sure that the other Component you want is already instanced during your ICmpInitializable.OnInit method, you can cache it there.

If I am not sure of that, I just add
Code:
if (otherComponent == null)
{
  otherComponent = ....
}

at the beginning of the ICmpUpdatable.OnUpdate implementation

_________________
Come on Duality's Discord channel. We have cookies! :mrgreen:


Top
 Profile  
 
PostPosted: 2015/01/29, 19:34 
Site Admin
Site Admin
User avatar

Joined: 2013/05/11, 22:30
Posts: 2073
Location: Germany
Role: Professional
openend wrote:
I feel like I should cache them in a kind of start function, right? Only once. Is the Init() method the right way to do that?


As long as performance is not a concern and you're not in a hotpath, you don't need to cache them. Just make sure to avoid unnecessary access (like four times in the same method), but other than this you're usually fine. GetComponent<T> is nothing more than a simple dictionary lookup in most cases.

Like SirePi said, you could so some lazy-init when needed, or even define a local private property as a wrapper for the access. Consider adding [NonSerialized] attributes to your cache fields as well.

Also, OnInit is not a bad place to update the cache - as long as you don't care whether the other objects are already initialized or not. Make sure to check the context parameter though - you probably want to update the cache in the Activate context only.

_________________
Blog | GitHub | Twitter (@Adams_Lair)


Top
 Profile  
 
PostPosted: 2015/01/29, 20:03 
Novice Member
Novice Member

Joined: 2015/01/27, 11:47
Posts: 11
Location: Germany
Role: Hobbyist
Thanks to you both, just old habits :)

I really like how much is exposed in Duality, nice work!
Now that I got that reference up and running, I start to understand things more and more.

One more question (I hope you dont get tired of me, many more to come :) )

I am trying to figure out how to show text at the position of a gameobject. Somehow I have to access the default camera for that, how would I access object in the current scene, or the scene itself? I got as far as to get the cam via gameObj.parentscene but somehow I have no possibility to declare a Camera field?

Am I missing a using directive? I cannot access ViewPort for example.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 4 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