Jump to content

  • Log In with Google      Sign In   
  • Create Account

Alectora

Member Since 19 Oct 2007
Offline Last Active Today, 01:36 AM

#5309760 Software design patterns for UI behaviors?

Posted by on 07 September 2016 - 01:03 AM

You can use MVC. Get data, get interface that needs the data, update it. Wait for callback if needed (animation callback, network callback, input callback, or whatever event callbacks).

As for your hide and close, not sure what you really wanna do about it, but you can use observer pattern, and register the functions (or any observer object you wish) which should be called (open/hide/close) by a specific button.


#5309571 How long would it take to get good at game art?

Posted by on 05 September 2016 - 06:34 PM

You got to keep practicing. Keep drawing.
Be curious on your drawing mistakes (read some drawing technique books so you can try out something you haven't tried before).
Take criticism (preferably from people you respect; mentor, friends who draw better or trying to be better like you [make an artist circle!]) so you can tell that there's something wrong with your drawing that you couldn't see.

There really is no other way I think.


#5307180 Is it inefficient to use Unity to turn 32kb of Javascript into a mobile app?...

Posted by on 22 August 2016 - 06:35 AM

If you are using pure JS, you can use cocos2d-js library or Phaser. You can use three.js for 3D. Wrap them with Crosswalk so it focuses on Chromium browser engine and not worry much on device differences (except for WebGL device-level features). That should give only what you need and definitely lower the file size and initial loading time.




#5307142 Preventing overengeneering

Posted by on 22 August 2016 - 02:00 AM

So my questions are:

 - How do you handle complex task and avoid laziness and lack of motivation?
 - How do you deal with over engineering?

 - Do you think that an average programmer would do more for those 3 years?

 - Any thing you wanna add? personal experience and suggestions.

 

  1. By keeping it small so you get a sense of reward for every goal you finished. It's a long project, so having some breaks from computer (and games!) for a few days or a week could help.
     
  2. I think from the things you wrote the last 3 years you haven't really mentioned anything related to your game other than just satisfying the lust of coding.
    Why do you need D3D11/OpenGL 3+? What kind of features do you need from those graphics API? tessellation? instancing? You want the game to be Windows 7 only and above? Why do you need flexible 3D formats? Do you really have to program with various 3D format and 3D tools? Why Linux support? Are you making the game for Linux? Do you have a Linux fanbase? Your tools are only in Linux? Do you really need a world editor? Does it has to be drag-n-drop? Does it has to be C++? etc.
    If you take these questions to the smallest bit, you can calculate how big your project is, and so you know what you need to do.

    Over-engineering is like when you put ::normalize() on your Vector2D class when you don't need direction at all.

    As many others have said here many times I think, don't make an engine, make things you need for the game. Hint, in-house tools aren't always pretty. ;)
     
  3. Depends on you and your project. Could be some parts of your project are too big to handle alone. If you are making a Final Fantasy XV from scratch, you should definitely know it takes hundreds of years to build by you alone.
    I think That Dust: An Elysian Tail game, a 2D sidescroller game, using XNA framework, by an animator, takes 3.5 years to develop alone. So you can have a hint on how long your game could take.
     
  4. My opinion is your project is probably too big. If in 3 years and you ask these questions, most likely you're out of track and forgot the size of your project. If you know that the project takes 8 years then you know it will take that long. I suggest you stop coding and re-read your game design and your project goals, then redefine feasible plan from now to finish, then start developing again.

    Put small tasks with short deadlines keeps you at pace. Have someone to be your boss if it's hard for you (mentor? friend? parents? wife/husband? children?). If you already master how to be your own boss, that's even better.

    Extremely beware of ideas in the middle of your journey. Always stick with your first scope of work. if you work alone, it's reallly easy for you to fall on filling ideas every second.



#5305578 Interfaces and code duplication

Posted by on 12 August 2016 - 10:20 PM

So, I could make a class called Renderable, which contains all the basic things such as position, graphics (or location of graphics at least). To make an object Renderable, I'd just add a pointer to an instance of the Renderable class, rather than directly inheriting from it.

 

My Renderer would need to take an object of type 'Renderer' - I think I see now where Interfaces fit in. I could make my object implement a 'Renderer' interface (but I'll not call it IRenderer, for fear of angering TheChubu...  :wink:  ) and implement a method to direct it to the renderer class. True, I'd need to duplicate those couple of lines but the actual heavy-lifting would be handled by the Renderer component.

 

How about: GameObject has a Renderer, Renderer is an abstract, so you can have any kind of concrete renderers attached to the GameObject. No interface needed. Unless Renderer can be anything else than Renderer itself that you decide to have it as interface ... which doesn't make any sense.

 

I just believe using interface is something that is highly general, like #init #update #shutdown kind of methods or the ones for finite state machine, something where you have to force any kind of classes to be like the interface (which should not be specific like Renderer).




#5300845 Vulkan Swapchain Unable To Create

Posted by on 15 July 2016 - 01:17 AM

Oh geez. Apparently I made a mistake on matching the image extent. Since currentExtent already exists, I just need to refer it to the currentExtent by default and it solves the problem.

 

I can only define the extent when the currentExtent dimension is -1. If I define the dimension myself while the current extent exists (or not -1), it throws that error because they don't match! (Well, as jhenriques' tutorial said)

 

So this one:

Window* window = Global::stage->getWindow();

VkExtent2D extent = {};

extent.width = window->width;
extent.height = window->height;

if (surfaceCapabilities.currentExtent.width == -1)
{
... 

Should be roughly like this:

VkExtent2D extent = surfaceCapabilities.currentExtent;

if (extent.width == -1)
{
    Window* window = Global::stage->getWindow();

    extent.width = window->width;
    extent.height = window->height;
...



#5297320 New Post about Gamma Correction

Posted by on 20 June 2016 - 09:39 AM

Hi Nikko, nice post. Can I ask a question related to this though? I'm new to this gamma correction and wants to apply it.

 

So, correct me if I'm wrong, if the consumer camera provides a gamma corrected picture stored in the hard drive so it can be converted by the monitor to obtain that linear space, what about the ones that are created with illustration tools like CLIP studio or Photoshop?

 

I am just wondering if I provide my own image/texture that aren't based from real camera shot, do I need to convert it first or something or what.




#5297108 Problem on referencing a vector of derived class

Posted by on 18 June 2016 - 01:34 AM

I'm not over-engineering. Actually I'm keeping it simple. I only use what I need to solve scalability issues I faced before. ECS is one example of good abstraction already for me. I started off without it on some small games. Time to time, the game gets a little bigger and the game objects become bloated with concrete variables cross-referencing to everybody, whether it's from various base classes or concrete class itself.

As it gets bigger, it gets crazier and difficult to maintain, faced by a deadline. ECS saved us, even though we may do it wrong a few times.

 

The abstraction doesn't come up out of nowhere. When I heard the advice about the concrete solution was seem to be the only option I can get, even if it solved my usability problem, I had to ask myself "What kind of problem will I get into later in the end?"

My mind is only filled with the fact that me and my colleague may end up working 24 hours just because things become tangled and difficult to maintain. We got a deadline to catch up, and by that we got to throw some hackish codes to make it seems fine. In the end we got into a lot of trouble when updating the game or reusing some parts of it for a new game.

My client can just email me and ask if this can be fixed/updated in X days and upload it, or ask what game I can make within X months after the last one. If we have no deadline and can publish anytime we like, we may not even think about it being difficult whatsoever.

 

If you worry that I'd keep abstracting things out, note that I am not making a game engine here, I'm making a game. I reuse anything from what I had before; game engine or not if anyone want to call it. Again, I don't address scalability I don't need or the ones that were not problematic before.

 

However, it's a broad interesting discussion about scalability that I'd rather open a new thread, since my use case on this one is already solved.

 

Thanks again everyone.  :D




#5294742 HTML5 / Javascript , box2dweb, createjs pitfalls?

Posted by on 02 June 2016 - 08:53 PM

If you're publishing HTML5 games with Cordova to mobile devices and not web, I highly, highly, recommend you to use Crosswalk. You can use CocoonJS as well.

 

The reason why I recommend you these is because normal PhoneGap/Cordova uses the default browser of the phone through WebView, and that every browser on that single phone may vary and most often can be broken. Those tools I recommended to you, wrapped your application along with a browser engine, which means you can say your game runs in the same browser, even though they are played on different devices. They usually focus on performance, but the downside is your application file size increases because there's a browser embedded to it; roughly around 25mb or so.

 

The other issue is processing power and memory usage as frob explained, but you got to test this on your own to make sure cause I don't know what kind of game you are making.




#5293990 Do you usually prefix your classes with the letter 'C' or something e...

Posted by on 28 May 2016 - 07:51 PM

The real question is, do you prefix your structs with the letter 'S'?

 

So far I also don't prefix struct with S cause I treat struct as an obvious collection of PODs ... something like EmployeeCard containing information about an Employee, instead of containing both information and behavior of what an Employee can do, which I prefer it as an Employee class.

 

So by that term alone, I have different naming for on struct or class, so I don't really need S or C prefixes on them.




#5293720 Do you usually prefix your classes with the letter 'C' or something e...

Posted by on 26 May 2016 - 10:53 PM

I'm doing exactly like Promit does, lol. But I have a habit to use lowercase on the first letter of every instance members, and uppercase on the first letter of every class members. This is because of JavaScript don't have static word in ES5 or less (you got to invent this yourself) and I've been with that language for quite a long time.

 

As for C for classes, no I never use it. Class names are pretty straightforward I don't have any trouble differentiating it from anything.




#5288466 Noob pointer question

Posted by on 24 April 2016 - 12:01 PM

Hi guys,

 

I've been in JavaScript for a very long time for work, and now back to C++ due to excitement of Vulkan. Of course, my hazy memory about pointers already got into me to lots of pointer errors. So here's a quick one...

 

Why is this working:

int* a = new int(5);
int* pA = a;
delete pA;

But this one isn't:

int a = 5;
int* pA = &a;
delete pA;

I may be wrong, but is it because I'm trying to delete a pointer (is it even a pointer I'm deleting?) allocated in reserved memory or something?

 

Thanks!




#5148147 My Custom Memory Pool Seems Too Slow. Need Advice.

Posted by on 19 April 2014 - 09:10 AM

After the clarification about the template issue, I tried to remove the map and decided to use the template instead. It removes the needs to find which pool I have to allocate (due to map), which increases the performance slightly (up to 0.1 sec) compare to the one that uses map and without template. If I reserve the capacity (by the total number of the test), it is reduced to 0.23 sec! The number of classes that would need this would probably at hundreds or less, unless doing such template that way is very expensive (I don't know).

 

EDIT: As Waterlimon suggested, I've changed the benchmark against the Car class to be quite a bit the same as Entity. The Car class now inherits Vehicle, where it has to pass a string through its constructor and save it to a name variable. Apparently this is the culprit. Now the Car increases up to 0.5x seconds!

Now everything looks quite normal, as a matter of fact, better!

 

Thanks a bunch guys!! you guys are very helpful. laugh.png




#5105976 Building a Modern 3d Game from the Ground Up a Realistic Goal?

Posted by on 31 October 2013 - 10:01 AM

Since you said you'll be very specific on your game engine, I think I don't mind for you to continue on. Of course, feature creep may get in your way so be careful for this, time will tell. I just hope it's just a hobby.

 

I think you should create a little risk management, but of course that depends on your goal. For example, if all you really want is the engine, you'll actually don't mind to give your life to make your specific 3D game engine. However, if your goal is the game, you'll set about X years phase for the game engine. If it's not quite feature complete/game development ready, you might want to switch to use current available game engines with extra 6 months of learning phase, or if the game engine is usable even at 50 - 75% completion, you can finally start the game development.

 

This way, since you've been dealing with the engine for a few years, fail or not, you know the scope of what specific graphics features are, and using someone's engine would be easier cause you know what you're looking for and you know how it works. So it's a win-win for you. Just set a deadline to motivate yourself on how long does the engine should be completed.

 

Trust me, no matter how many years/features you put on your game engine to be perfect, when you finally start creating the game using that engine, you'll always want to fix your engine where someone else could do the job. I've been there, and it's quite a long journey for one man's brain to go back and forth from engine to the game itself just to fix a little something (happens a lot and not to mention architectural/design failures; it's crazy, you might want to take a little vacation when that happen. which usually you'll end up letting it happen until the next big refactoring, the engine v2 roadmap).

 

Forgot: About Java/C++, since you want performance you might want to try C++. About the graphics API, that depends on your target platform.




#5105538 JavaScript literal object as C++ struct?

Posted by on 29 October 2013 - 07:18 PM

Technically, C++ structs are almost identical to classes (with just a minor difference in default visibility).  Realistically, C++ structs are typically used like C structs, or your Javascript Plain-Old-Data object above.  Limiting it to that is actually pretty valuable.

Cool Thanks! Now I'm more confident to limit my struct usage to just POD. :)






PARTNERS