[PloobsEngine] Tutorial 5 – Initialization Parameters


This tutorial will talk about the PloobsEngine Initialization Parameters. (tutorials series here)

The tutorials so far used some “curious” options when initializing the engine, now we will talk about each of those misterious choices. =P

In every engine sample, we have the following block of the code (when starting the engine).

            InitialEngineDescription desc = InitialEngineDescription.Default();
            ///start the engine
            using (EngineStuff engine = new EngineStuff(ref desc, LoadScreen))
            {
                engine.Run();
            }

We are just creating a simple object describing the engine initialization confs, providing it to the EngineStuff constructor and starting the PloobsEngine workflow.

Now we will talk about the InitialEngineDescription object in depth.

We can create the InitialEngineDescription using the static method Default or using the detained constructor. The following block discuss a little about the parameters you can change in this object.

  • BackBufferHeight: the resolution of the screen in Y (if windowed also controls the Y size of the screen)
  • BackBufferWidth: the resolution of the screen in X (if windowed also controls the X size of the screen)
  • isFullScreen: If true, the game will run in fullscreen mode, if not, windowed.
  • GraphicsProfile: The engine only support HiDef profile in this release. We plan to use this field to load in run time the right DLL for the users.
  • isFixedGameTime: If true, the engine will force the game to be 60 FPS (and will try to ensure the game has this minimum FPS, if it is slower than this, the draw method  will be called less times). When debuggingm i suggest to turn this off (so the FPS will be real).
  • isMultiSampling: to use force using Multisampling  (Anti Aliasing method). This ONLY works in Forward Rendering. If you enable this in deferred we will use Multisampling but the quality wont be improved a lot (cause under XNA (DirectX 9c) we dont have Multisample when using Multiple Render Targets). We suggest to turn this off in lower specs PCs when Deferred Render is used. Under Deferred Render, try using Post effects AA technichs (will be explained in next tutorials =P)
  • Logger: Interface provided by the user (can be null) where the engine logs problems (will be discussed more later in this article)
  • OnExit: Event called when the engine exits
  • ScreenName: The name you want to the engine screen
  • UnhandledException_Handlerquality
  • UseAnisotropicFiltering: Use Anisotropic Filtering instead of Linear filtering when possible (better quality but slower)
  • useMipMapWhenPossible: Improve Texture filtering using MipMaps when possible (better quality but slower)
  • UseVerticalSyncronization: Sync the graphics drawing with the monitor refresj frequency (recomended, but forces the draw FPS to 60)

Engine Default

When you call the static method Default of the the InitialEngineDescription, the following options are used:

public InitialEngineDescription(string ScreenName = "PloobsEngine", int BackBufferWidth = 800, int BackBufferHeight = 600, bool isFullScreen = false, GraphicsProfile graphicsProfile = GraphicsProfile.HiDef, bool useVerticalSyncronization = false, bool isMultiSampling = false, bool isFixedGameTime = false, ILogger logger = null, bool useMipMapWhenPossible = false, bool UseAnisotropicFiltering = false);

ILogger

The PloobsEngine Debug DLL (the one provided) sometimes logs messages to the user. These messages can be:

  • Warnings: Whe the user does something that is not wrong, but normally is not what “user wants” to do. The message is just a “Are you sure you want to do this ???”
  • Recoverable Errors: When the user make a error somewhere, but the engine can recover from it (THE USER SHOULD correct the source of the problem), normally the engine aborts the current operation when recoverable  errors happens, ao unexpected stuffs can happen.
  • Fatal Error: This happens when the user does something that CANNOT be done. This is normally folowed by an Exception being thrown.

The user can provide a implementation of the interface ILogger to the InitialEngineDescription object (if not provided, nothing is logged … we STRONGLY recomend implementing this). The following code show the interface:

public interface ILogger
    {
        void Log(string Message, LogLevel logLevel);
    }

It is pretty simple, you override the Log method. The LogLevel can be Warning, Fatal Error and Recoverable Error as dicussed. We tried to not use the ILogger in code that runs everytime, so you can write to files, write to server … in the implementation (we suggest you to dont do this in production code, try to use Threads or something assync to proccess the message).In debug a simple Debug.WriteLine is enough =P

Users can also log messager using this log system. Just use the following static method: (everywhere, after the EngineStuff constructor)

PloobsEngine.Engine.Logger.ActiveLogger.LogMessage(message,PloobsEngine.Engine.Logger.LogLevel.LOGLEVEL_YOU_WANT);

Unhandled Exception

Sometimes, the engine can throw exeptions to the user (When fatal error happens (user mistake),when XNA/Windows fails, when engine bugs decide to appear =P … ). The engine normally does catch those exception, so the user can handle them (you cant recover, your job is to “something” like write to a log file or server, before the end the of the execution). To use this funcionality, you just need to provide a method with the following signature to the InitialEngineDescription.

public delegate void UnhandledException(object sender, UnhandledExceptionEventArgs e);

Its all for today (small tutorial =P)

Any doubts, critics, suggestions, pls go to our forum or leave a comment here.

See you guys =P

Links

 

, , , ,

  1. #1 by bilge pump boat on 27 de agosto de 2016 - 10:25 am

    I am glad to be a visitant of this pure site, appreciate
    it for this rare info!

  2. #2 by Mincraft on 27 de agosto de 2016 - 10:26 am

    I really like your blog.. very nice colors & theme. Did you design this website
    yourself or did you hire someone to do it for you? Plz answer back as I’m looking
    to create my own blog and would like to find out where u got this from.
    cheers

  3. #3 by taller in more ways on 27 de agosto de 2016 - 10:28 am

    Yet in some industrialised nations around the world,
    notably the United States, the peak gains since the nineteenth Century have essentially levelled off.

  4. #4 by most nutritious food on 27 de agosto de 2016 - 10:34 am

    Very shortly this web site will be famous amid all blog people, due to it’s pleasant posts

  5. #5 by best organic skin care products reviews 2012 on 27 de agosto de 2016 - 10:43 am

    Along with its moisturizing qualities, it can help restore skin cells and restores the protective film
    of skin.

  6. #6 by http://dhomerotravel.com/index.php?option=com_k2&view=item&layout=item&id=235&Itemid=760 on 27 de agosto de 2016 - 10:48 am

    What’s up to all, how is everything, I think every one is getting more from this web site, and your views
    are good designed for new people.

  7. #7 by Faustino on 27 de agosto de 2016 - 10:55 am

    Even though Idoo tske pleasure in initial person shooters
    – my ffav is nevertheless Doom 3 – I do like an ctual
    storyline rather of the senseless shooting match portrayed below,
    even so, it does search like a great way to de-pressure!

  8. #8 by Www.youtube.Com on 27 de agosto de 2016 - 10:58 am

    The other day, while I was at work, my sister stole my apple ipad and tested to see if it
    can survive a twenty five foot drop, just so she can be a
    youtube sensation. My apple ipad is now destroyed and she has 83
    views. I know this is totally off topic but I had to share it
    with someone!

  9. #9 by Reinaldo on 27 de agosto de 2016 - 10:59 am

    Hello to all, how is the whole thing, I think every one is getting more from this site,
    and your views are pleasant for new visitors.

  10. #10 by healthy eating food list on 27 de agosto de 2016 - 11:03 am

    Hmm is anyone else having problems with the images on this blog
    loading? I’m trying to figure out if its a problem on my end or if it’s the blog.
    Any responses would be greatly appreciated.

  11. #12 by Glinda on 27 de agosto de 2016 - 11:08 am

    I like this web site very much so much wonderful information.

  12. #13 by pss shaft on 27 de agosto de 2016 - 11:09 am

    This piece of writing is genuinely a fastidious one it assists new web viewers, who
    are wishing for blogging.

  13. #14 by Fae on 27 de agosto de 2016 - 11:09 am

    Howdy! I know this is kinda off topic however , I’d figured I’d ask.

    Would you be interested in exchanging links or maybe guest
    authoring a blog article or vice-versa? My site discusses a lot of the same
    subjects as yours and I feel we could greatly benefit from each other.
    If you are interested feel free to shoot me an e-mail. I
    look forward to hearing from you! Excellent blog by the way!

  14. #15 by coupondunia on 27 de agosto de 2016 - 11:09 am

    Hi there Dear, are you actually visiting this site daily,
    if so afterward you will definitely obtain fastidious know-how.

  15. #16 by mesin bakso mini on 27 de agosto de 2016 - 11:16 am

    Mesin Bakso merupakan mesin yang digunakan untuk membuat bakso yang termasuk dalam kategori mesin pengolah daging.

    Mesin ini sangat cocok untuk pengusaha bakso dalam membantu pembuatan bakso bersekala
    menengah dan besar yang setiap hari produksi baksonya harus mencetak
    ribuan bakso untuk di pasarkan pada usaha warung
    bakso atau untuk di jual di pasar sebagai bakso kering yang siap di
    pakai untuk campuran masakan ibu-ibu di rumah.

  16. #17 by prediksi bola malam ini akurat,prediksi liga inggris hari ini,prediksi liga champion musim ini,prediksi bola menang hari ini,prediksi bola menang,live score spbo,liveskor liga jerman,Live score liga inggris,spbo live score dan prediksi,spbo live score dan on 27 de agosto de 2016 - 11:21 am

    You made some really good points there. I checked on the net for more info about the issue and found most people will go along with your views on this site.

  17. #18 by play doh videos on 27 de agosto de 2016 - 11:36 am

    Hello i am kavin, its my first occasion to commenting anywhere, when i read this post i
    thought i could also create comment due to this brilliant paragraph.

  18. #19 by Windows 7 Loader by Computer Smarts on 27 de agosto de 2016 - 11:40 am

    Hmm is anyone else experiencing problems with the images on this blog loading?
    I’m trying to find out if its a problem on my end or if it’s the blog.
    Any feedback would be greatly appreciated.

  19. #20 by situs nonton film indonesia online on 27 de agosto de 2016 - 11:44 am

    Hi there, all the time i used to check web site posts here early in the morning, for the reason that i love to find out more and
    more.

  20. #21 by leijalauta on 27 de agosto de 2016 - 12:00 pm

    You made some really good points there. I checked on the
    net to find out more about the issue and found most people
    will go along with your views on this site.

  21. #22 by black hair care on 27 de agosto de 2016 - 12:01 pm

    hello there and thank you for your information ? I have definitely
    picked up anything new from right here. I did however expertise a few technical points using this web site, as I experienced to reload
    the web site lots of times previous to I could get it to load correctly.
    I had been wondering if your web host is OK? Not that
    I am complaining, but sluggish loading instances times will often affect your placement in google and can damage your high quality score
    if advertising and marketing with Adwords. Well I am adding this RSS to my email and could look out for a lot more of your
    respective intriguing content. Ensure that you update this again soon.

  22. #23 by Malissa on 27 de agosto de 2016 - 12:03 pm

    I see many interesting posts here. Your website
    can go viral easily, you need some initial
    traffic only. How to get initial traffic?? Search google for:
    Jemensso’s tricks

  23. #24 by bilge pump boat on 27 de agosto de 2016 - 12:04 pm

    Hi everyone, it’s my first pay a visit at this web page, and piece of writing is truly fruitful
    in support of me, keep up posting these posts.

  24. #25 by Myron on 27 de agosto de 2016 - 12:13 pm

    Oh my goodness! Amazing article dude! Many thanks, However I am
    experiencing issues with your RSS. I don’t know why I cannot subscribe to it.
    Is there anyone else getting similar RSS issues?

    Anyone that knows the solution can you kindly respond? Thanks!!

  25. #26 by Dulcie on 27 de agosto de 2016 - 12:17 pm

    I was looking at some of your posts on this internet site and I believe this website is really instructive!
    Retain putting up.

  26. #27 by Orville on 27 de agosto de 2016 - 12:22 pm

    Hey I know this is off topic but I was wondering if you knew of any
    widgets I could add to my blog that automatically tweet my
    newest twitter updates. I’ve been looking for a plug-in like this for quite some time
    and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything.

    I truly enjoy reading your blog and I look forward to your new
    updates.

  27. #28 by diet and healthy eating on 27 de agosto de 2016 - 12:25 pm

    Heya are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and create my own. Do you need any coding knowledge to make your own blog?

    Any help would be really appreciated!

  28. #29 by a on 27 de agosto de 2016 - 12:28 pm

    Magnificent beat ! I would like to apprentice whilst you amend your site, how could i
    subscribe for a weblog site? The account helped me a appropriate deal.
    I have been a little bit familiar of this your broadcast offered vibrant
    clear idea

  29. #30 by play doh peppa pig on 27 de agosto de 2016 - 12:28 pm

    Wow that was odd. I just wrote an really long comment but after
    I clicked submit my comment didn’t show up. Grrrr… well I’m not writing all that over again. Regardless, just wanted to say superb blog!

  30. #31 by Concepcion on 27 de agosto de 2016 - 12:31 pm

    I like this site very much so much great info.

  31. #32 by house training on 27 de agosto de 2016 - 12:39 pm

    Wow, awesome weblog layout! How lengthy have you ever been running a blog for?
    you made running a blog look easy. The full look of your website is great, as well
    as the content material!

  32. #33 by SATTA MATKA on 27 de agosto de 2016 - 12:43 pm

    very handful of internet websites that happen to become detailed beneath, from our point of view are undoubtedly nicely really worth checking out

  33. #34 by Find the new solution to get revenge of Ball on 27 de agosto de 2016 - 12:43 pm

    Today, while I was at work, my sister stole my iPad and tested to see
    if it can survive a thirty foot drop, just so she can be a youtube sensation.
    My iPad is now broken and she has 83 views. I know this is totally off topic but I had to share it with someone!

  34. #35 by hair care on 27 de agosto de 2016 - 12:55 pm

    Hi there everyone, it’s my first go to see at this web site,
    and article is really fruitful in favor of me, keep up posting these articles or reviews.

  35. #36 by Phillis on 27 de agosto de 2016 - 12:58 pm

    I was reading some of your posts on this website and I believe this web site is really informative!
    Keep on putting up.

  36. #37 by Shay on 27 de agosto de 2016 - 1:06 pm

    hey there and thank you for your information ?
    I have definitely picked up something new from right here.
    I did however expertise several technical issues using this web site, since
    I experienced to reload the site a lot of times previous to I
    could get it to load properly. I had been wondering if your hosting is OK?

    Not that I’m complaining, but slow loading instances times will very frequently affect
    your placement in google and can damage your quality score
    if ads and marketing with Adwords. Well I am adding this RSS to
    my email and can look out for much more of your respective fascinating content.
    Ensure that you update this again very soon.

  37. #38 by no title on 27 de agosto de 2016 - 1:09 pm

    In the past fashion was more about women clothing and not much preference
    was given to a man’s clothing range.

  38. #39 by 鼻づまり解消 on 27 de agosto de 2016 - 1:10 pm

    鼻づまりは相当にしんどいです。 なにしろ、生命がかかってるからです。
    こういったことは普通の人には全くわからないものです。
    鼻づまりは睡眠障害を引き起こします。 それは言うまでもないです。
    誰もその辛さは実感できません。 他の人は楽に呼吸してるからです。

  39. #40 by www.thefamilypet.info on 27 de agosto de 2016 - 1:12 pm

    Good day! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in trading links or maybe guest writing
    a blog article or vice-versa? My site goes over a lot of the same topics as yours and I think we could greatly benefit from each
    other. If you are interested feel free to shoot
    me an e-mail. I look forward to hearing from you!
    Great blog by the way!

  40. #41 by pedophile on 27 de agosto de 2016 - 1:20 pm

    I’m not sure exactly why but this site is loading very slow for
    me. Is anyone else having this issue or is it a issue on my
    end? I’ll check back later and see if the problem still exists.

  41. #42 by helthy food on 27 de agosto de 2016 - 1:28 pm

    I’m not sure why but this website is loading incredibly slow for me.
    Is anyone else having this problem or is it a problem on my end?

    I’ll check back later and see if the problem still exists.

  42. #43 by Mincraft on 27 de agosto de 2016 - 1:29 pm

    Hello, this weekend is good in support of me, because this time i am reading this impressive
    informative article here at my home.

  43. #44 by coaching on 27 de agosto de 2016 - 1:42 pm

    Link exchange is nothing else but it is only
    placing the other person’s weblog link on your page at suitable place and other person will also do similar for you.

  44. #45 by ley de atraccion on 27 de agosto de 2016 - 1:44 pm

    I have to thank you for the efforts you have put in penning this site.
    I’m hoping to view the same high-grade blog posts from you in the future as well.
    In truth, your creative writing abilities has motivated me to get my very own blog now 😉

1 735 736 737
(não será publicado)