« first day (3118 days earlier)      last day (1918 days later) » 

1:26 AM
@bruglesco It depends on the question :) In any case, it is certainly on-topic in chat!
 
@AlexandreVaillancourt okay. Then a little more about the question. It mostly has to do with the design of my GUI.
I have multiple 'screens' each one is unique. for instance: Main Menu, Upgrade Screen, Map, Battle Screen
My design is to have a custom enum with a value for each screen and then a stack<ScreenType>. I then display the screen that matches the enum on the top()
Each Screen is a separate class with a single instance.
My biggest concern is that the screens are potentially singeltons without single instance enforcement (but also, blessedly, without being globals)
My second concern is I am a neophyte and that I am just doing it all the wrong way.
(If I post to main I will write it a bit better than that)
 
I think the answer you'll get is "well if it works for you and your game, it's ok" unless you're able to pin-point a specific issue you have with this.
(If you post this on the main site).
And about your specific issue, are you sure you'll need to display only one screen at a time?
 
Well... I designed every screen and the navigation between them. So in its current form yes. However it never even occurred to me to consider displaying more than one screen at a time or how to go about that.
 
Would it be possible, eventually, to see the Battle screen while the Upgrade screen or the Pause screen are displayed on top of it (with potential animations, like trees reacting to wind, and such)?
 
1:41 AM
by designed I mean wrote plans. no code
(okay I guess that's what that meant all along)
I might be over clarifying. I did do a pop-up for the pause menu. It isn't treated like a screen
 
Thinking before writing is the best time/effort saver ever :P
Your design seems fine to me. The other way I would have done it would have been using a State Machine.
 
Definitely. I learned that the hard way. Although I still charge in without thinking more often than I should. Especially if I get excited about something.
 
Hehe we all do ;)
 
Well FSM was the idea behind the stack<Screen>
 
Yeah, well if that's the case, you might want to think first what screen can transition to what screen; perhaps then a stack might not be the best way to go about it.
Last time I did such a state machine, I did not create an enum for that; the states are named, and the state transitions are based on strings only. StateA knows to which state it transitions to (using strings), this allows to add states without the need to modify a "central repository", which remains agnostic to what states exist.
 
1:54 AM
hmm
Okay, so I like that, but I have a central 'View' class that is responsible for display. It is what owns the stack. So If I just use transitions as strings how do I inform the View of my choice?
 
View seems to be your state machine, yes.
The "annoying" thing is that something needs to know what screens to add.
 
But then the repository is in the View? just std::stack<std::string>?
 
You could still have your view add those states/screens; and the screens know about the view.
std::map<string, Screen>
hold on
I built it like this (roughly):
class IScreen
{
p1ublic:
  virtual void onEnter() = 0;
  virtual void onUpdate() = 0;
  virtual void onExit() = 0;
}

class View
{
public:
  View();

  void changeScreenTo(std::string aNewScreen);

private:

  std::map<std::string, std::unique_ptr<IScreen>> mScreens;

  IScreen* mCurrentScreen;
}

View::View()
{
  mScreens.insert( ScreenBattle().getName(), std::make_unique<ScreenBattle>() );
  mScreens.insert( ScreenMainMenu().getName(), std::make_unique<ScreenMainMenu>() );
  mScreens.insert( ScreenUpgrade().getName(), std::make_unique<ScreenUpgrade>() );
So yeah, aside from adding the screens to your the repository, the view would not need to know anything about it. You could even defer it to another class, and your view would not need to know anything about what screens exist.
Then your MainMenu screen only needs to know the name of the Battle screen, and your Upgrade screen only needs to know about the name of your Battle screen (for instance).
 
2:12 AM
That is very helpful. Thank you.
 
:)
And, well, you can adapt it however you like.
 
Did you just hammer that out? Because that's impressive.
 
Thing is; every time you re-write a piece of code in a new project, you remember how you got burned with the last project and try to improve...
I just typed it, yes.
 
@AlexandreVaillancourt Well now I'm trying to overcome the fear of writing code that I am uncertain of because Im afraid its gonna burn me somehow.
It's been slowing me down a bit
 
@bruglesco Bah, I usually think of the architecture first, then build it. It helps me to think that no code is perfect and there will be stuff that will not be optimal.
And I learn from it.
And I'm still paid for that, so I guess it's not really an issue :P
 
2:21 AM
Well I'm just trying to get better so that one day I can get paid. In the meantime I'm just trying to enjoy it along the way and maybe make a thing or two I'm proud of.
 
Once you have something, you can show it to companies; if they need some devs, they might hire you. There is nothing like working as a dev to learn, specially when there is someone with more experience from which you can learn!
 
That's the goal
 
Are there a lot of gamedev companies around where you live?
 
Yes. Im in Pittsburgh. We have a lot of tech here.
 
Ok, that's good; you might want to take a look at those companies' "career" sections and see what they seek; if they're interested in c#/unity devs, you might want to focus on that instead, if that's only what you want. But any experience is good, so even if you build a game in c++ then you'll have some different opportunities :)
 
2:34 AM
Yeah Im trying to learn multiple languages to increase my marketability. But also because: why know just one language, or one paradigm, or one library, or just one of anything really?
 
That's a great state of mind! Gotta find the right balance between learning in breath and learning in depth.
 
@AlexandreVaillancourt That's the hardest part for sure.
 
You're self teaching?
 
yup
 
That's great, and hard :) But getting something done is the best way to learn, I think, so you're on the right path!
 
2:46 AM
which is why I have to come here for questions about design decisions
 
Yeah, no worries; I've been developing professionally for more than 15 years; I still have questions :P
 
Thanks, I appreciate the encouragement. That's the thing that self-teaching lacks the most. But all in all I think its going well. At least it is something I genuinely enjoy for the sake of doing. Not just for the long-term potential gains
 
Yeah, building stuff that works is fun! Programming is cheap and you can achieve nice results ;)
 
I love solving things too. It's a constant string of tackling the next problem.
 
Yeah; and the next problem is never the same :P
 
2:53 AM
And the supply of problems never seems to end
 
Yeah, that's a great way to keep on getting paid hehe
 
3:23 AM
Thanks for all your help @AlexandreVaillancourt. Have a good night.
 
@bruglesco Anytime, good night :)
 
3:51 AM
Yeh, finally been able to setup a Ubuntu VM box to act as an adblocker proxy :P
 
I'm just proud I know what those words mean
(goes back to sleep)
 
haha ;)
good night :)
 
 
11 hours later…
2:30 PM
Good morning!
 
user92578
hi
 
How are ya? Haven't talked to ya in a long time
 
user92578
2:44 PM
I'm all right, a little over 4 weeks of military left, looking forward to being moved onto the reserve
 
user92578
You?
 
Good. Almost done with my 11th grade year of high school. Planning on where I wanna go to college.
Still working on my Indie RPG game.
@Tyyppi_77 also been kinda beating around the bush with my parents, since my father wants me to be an anesthesiologist (the guy that gases you before surgery), despite me having no interest in medicine.
@Pikalek i could have swore it was called Depression D💔y, not V❤lentine's D❤y.
Lol I went and did it again: left a friggin novel
 
 
2 hours later…
Kay
5:25 PM
Can I prevent this "turning"-effect on linerenderer when it does not make straight lines or do I have to roll my own code for this
 
 
2 hours later…
7:34 PM
0
Q: Is it possible to apply a texture to a 2D-sprite in unity 2-d?

C_Z_I want to take an (animated) 2-d sprite and apply a texture to it. Basically, I want every non-transparent pixel to be covered by the texture (color is disregarded). I understand I can probably accomplish this using masks but I am worried that may not be the most performant solution. I know you c...

 

« first day (3118 days earlier)      last day (1918 days later) »