[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 sky phone number on 24 de março de 2017 - 3:36 am

    Hi my loved one! I wish to say that this post is awesome,
    nice written and include approximately all important infos.
    I’d like to look more posts like this .

  2. #2 by male enhancement reviews on 24 de março de 2017 - 3:40 am

    Thanks for the write up. I certainly agree with what you’re saying.
    I have been discussing this subject a lot recently with my brother so hopefully this will
    get him to see my point of view. Fingers crossed!

  3. #3 by lookity on 24 de março de 2017 - 3:52 am

    This design is spectacular! You certainly know how to keep a
    reader entertained. Between your humor and your videos, I
    was almost moved to begin my own blog. Great job.
    I truly enjoyed what you had to say, and in addition to that, how you presented it.
    Too great!

  4. #4 by Kurtis on 24 de março de 2017 - 3:55 am

    I have been surfing online more than 2 hours today, yet
    I never found any interesting article like yours. It is
    pretty worth enough for me. Personally, if all website owners
    and bloggers made good content as you did, the web
    will be a lot more useful than ever before.|
    I could not resist commenting. Exceptionally well written!|
    I’ll right away take hold of your rss as I can not in finding your email subscription hyperlink or
    newsletter service. Do you have any? Please permit me
    realize in order that I could subscribe. Thanks.|
    It’s perfect time to make some plans for the future and it’s time to be happy.
    I’ve read this post and if I could I want to suggest you few
    interesting things or suggestions. Perhaps you can write next articles referring to this
    article. I wish to read even more things about it!|
    It’s perfect time to make some plans for the
    longer term and it’s time to be happy. I have learn this publish and
    if I may just I wish to recommend you few interesting
    issues or tips. Maybe you could write next articles regarding this article.

    I wish to read more things approximately it!|
    I have been browsing online greater than 3 hours today, yet I never discovered
    any attention-grabbing article like yours. It’s pretty price sufficient for me.

    In my opinion, if all website owners and bloggers made good content
    material as you did, the net will probably be much more useful than ever before.|
    Ahaa, its good conversation about this paragraph here at this weblog, I
    have read all that, so at this time me also commenting here.|
    I am sure this paragraph has touched all the internet users,
    its really really nice piece of writing on building up new webpage.|
    Wow, this article is pleasant, my sister is analyzing such things, so I am going to tell her.|
    Saved as a favorite, I really like your website!|
    Way cool! Some very valid points! I appreciate you penning this article
    plus the rest of the website is also really good.|
    Hi, I do think this is an excellent site. I stumbledupon it 😉 I may come back yet again since I bookmarked
    it. Money and freedom is the best way to change, may you be rich and continue to guide
    other people.|
    Woah! I’m really enjoying the template/theme of this website.
    It’s simple, yet effective. A lot of times it’s difficult to get that “perfect balance” between superb
    usability and visual appearance. I must say you’ve done a
    awesome job with this. Also, the blog loads extremely fast for me
    on Safari. Exceptional Blog!|
    These are actually wonderful ideas in on the topic of blogging.
    You have touched some good things here. Any way keep up wrinting.|
    I really like what you guys tend to be up too.
    This type of clever work and coverage! Keep up the very
    good works guys I’ve you guys to my personal
    blogroll.|
    Hi! Someone in my Facebook group shared this website with us so I came to give it a
    look. I’m definitely enjoying the information. I’m bookmarking and will
    be tweeting this to my followers! Fantastic blog and fantastic design.|
    I enjoy what you guys tend to be up too. This type of
    clever work and coverage! Keep up the fantastic works guys I’ve added
    you guys to my blogroll.|
    Hey would you mind sharing which blog platform you’re using?
    I’m planning to start my own blog soon but I’m having a tough time
    making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs
    and I’m looking for something completely unique.
    P.S Apologies for being off-topic but I had to ask!|
    Hi there would you mind letting me know which hosting company you’re using?
    I’ve loaded your blog in 3 completely different browsers and I must say this blog loads a lot faster then most.
    Can you recommend a good internet hosting provider at a reasonable price?
    Kudos, I appreciate it!|
    I love it when people get together and share views. Great blog,
    stick with it!|
    Thank you for the good writeup. It in fact was a amusement account it.
    Look advanced to far added agreeable from you!
    However, how can we communicate?|
    Hello just wanted to give you a quick heads up. The words in your post seem to
    be running off the screen in Safari. I’m not sure if this is a format issue or something to do
    with internet browser compatibility but I thought I’d post to let you know.
    The style and design look great though! Hope you get the issue solved soon. Many thanks|
    This is a topic which is close to my heart… Many thanks!
    Exactly where are your contact details though?|
    It’s very effortless to find out any topic on net as compared to books, as I found this piece of writing at
    this site.|
    Does your site have a contact page? I’m having a
    tough time locating it but, I’d like to send you an e-mail.
    I’ve got some recommendations for your blog you
    might be interested in hearing. Either way, great site and I look forward
    to seeing it expand over time.|
    Greetings! I’ve been reading your site for a while now and finally got the bravery to go
    ahead and give you a shout out from Atascocita Texas!
    Just wanted to tell you keep up the excellent job!|
    Greetings from Los angeles! I’m bored at work so I decided to check out your site on my iphone
    during lunch break. I love the information you provide here
    and can’t wait to take a look when I get home. I’m surprised at how
    fast your blog loaded on my phone .. I’m not even using WIFI, just 3G
    .. Anyhow, awesome site!|
    Its such as you read my mind! You seem to know so much approximately this,
    such as you wrote the e book in it or something. I feel that you can do with some percent to force the
    message house a bit, but instead of that, this is wonderful blog.
    A great read. I will certainly be back.|
    I visited various web sites except the audio feature for audio songs current at
    this web page is actually marvelous.|
    Hello, i read your blog occasionally and i own a similar one and i was just curious
    if you get a lot of spam remarks? If so how
    do you prevent it, any plugin or anything you can advise? I get
    so much lately it’s driving me mad so any help
    is very much appreciated.|
    Greetings! Very helpful advice within this article!
    It’s the little changes that make the biggest
    changes. Thanks for sharing!|
    I truly love your site.. Excellent colors & theme.
    Did you develop this site yourself? Please reply back as I’m attempting to create my own personal website and would like to learn where you got this from or what the theme is named.
    Thanks!|
    Hi there! This article couldn’t be written any better!
    Looking through this post reminds me of my previous roommate!

    He constantly kept preaching about this. I am going to send this article
    to him. Fairly certain he will have a very good read.
    Many thanks for sharing!|
    Wow! This blog looks exactly like my old one! It’s on a totally different topic but it has pretty much the same layout and design. Great choice
    of colors!|
    There’s certainly a lot to find out about this subject. I really
    like all the points you’ve made.|
    You’ve made some really good points there. I looked on the web
    for more information about the issue and found
    most people will go along with your views on this web site.|
    Hello, I check your blog regularly. Your humoristic style is witty,
    keep up the good work!|
    I just couldn’t go away your website prior to suggesting that I actually loved
    the standard information a person supply for your visitors?

    Is gonna be back regularly in order to check out new posts|
    I needed to thank you for this very good read!! I certainly enjoyed every little bit of it.
    I have got you book-marked to check out new things you post…|
    What’s up, just wanted to say, I liked this post.
    It was inspiring. Keep on posting!|
    Hi there, I enjoy reading through your article post.
    I like to write a little comment to support you.|
    I constantly spent my half an hour to read this webpage’s articles daily along
    with a mug of coffee.|
    I every time emailed this web site post page to all
    my contacts, for the reason that if like to read it afterward my friends will too.|
    My programmer is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the
    expenses. But he’s tryiong none the less. I’ve been using WordPress on a variety of websites for about a year
    and am worried about switching to another platform. I have heard great
    things about blogengine.net. Is there a way I can transfer all my wordpress content into it?

    Any help would be really appreciated!|
    Howdy! I could have sworn I’ve been to your blog before but after browsing through a few of
    the articles I realized it’s new to me. Nonetheless, I’m certainly pleased I discovered it and I’ll be book-marking it and checking back often!|
    Terrific work! This is the kind of information that are supposed to be shared across the internet.

    Shame on the seek engines for not positioning this put up upper!
    Come on over and visit my site . Thanks =)|
    Heya i’m for the first time here. I came across this board and I find It truly useful & it helped me out a lot.
    I hope to give something back and help others like you aided me.|
    Howdy, I believe your blog may be having browser compatibility
    problems. Whenever I take a look at your web site in Safari, it looks fine however, when opening in IE, it has some overlapping issues.
    I simply wanted to give you a quick heads up! Other than that, fantastic blog!|
    Someone necessarily assist to make severely articles I’d state.
    This is the very first time I frequented your web page and so far?

    I surprised with the research you made to create this particular submit extraordinary.
    Excellent activity!|
    Heya i am for the first time here. I found this board and I find It
    truly helpful & it helped me out a lot. I’m hoping to present something again and aid others such as
    you helped me.|
    Hi! I just want to give you a big thumbs up for the excellent information you have got here on this post.

    I am returning to your site for more soon.|
    I always used to read article in news papers but now as I am
    a user of internet thus from now I am using net for content,
    thanks to web.|
    Your mode of explaining everything in this article is
    really good, every one be able to easily understand
    it, Thanks a lot.|
    Hi there, I discovered your web site by the use of Google whilst looking for a
    related subject, your website got here up, it appears
    to be like good. I have bookmarked it in my google bookmarks.

    Hi there, just became aware of your weblog via Google, and located that it is really informative.
    I am going to be careful for brussels. I will appreciate in the event you proceed
    this in future. A lot of people can be benefited out of your writing.
    Cheers!|
    I’m curious to find out what blog system you’re working with?
    I’m having some small security issues with my
    latest blog and I would like to find something more risk-free.

    Do you have any recommendations?|
    I am extremely impressed with your writing skills as well as
    with the layout on your weblog. Is this a paid theme or did you customize it yourself?
    Anyway keep up the nice quality writing, it’s rare to see a
    nice blog like this one these days.|
    I am really inspired with your writing talents and also with the format in your blog.
    Is that this a paid topic or did you customize it your self?
    Either way stay up the excellent high quality writing, it
    is uncommon to see a nice weblog like this one these days..|
    Hi, Neat post. There’s a problem with your website in internet explorer,
    could check this? IE nonetheless is the market leader and a
    big part of folks will leave out your great writing because of this problem.|
    I’m not sure where you’re getting your information, but great topic.
    I needs to spend some time learning much more or understanding
    more. Thanks for fantastic information I was looking for this info
    for my mission.|
    Hello, i think that i saw you visited my weblog thus i came to “return the favor”.I’m trying to find things to
    improve my website!I suppose its ok to use {some of|a few
    of\

  5. #5 by pussy fuck on 24 de março de 2017 - 4:04 am

    Hi there everyone, it’s my first go to see at this web page,
    and paragraph is actually fruitful for me, keep up posting such articles.

  6. #6 by game controller joystick on 24 de março de 2017 - 4:16 am

    Do you mind if I quote a couple of your articles as long as I provide credit and sources back to your site?
    My website is in the very same niche as yours and my users would really benefit from some of the information you provide here.
    Please let me know if this alright with you. Cheers!

  7. #7 by sky telephone number on 24 de março de 2017 - 4:28 am

    Highly descriptive article, I liked that bit. Will there be a part 2?

  8. #8 by Paulo Davi Lucas on 24 de março de 2017 - 4:33 am

    É verosímil reduzir a queda de cabelo com uma dieta salutar,
    rica em frutas e também vegetação.

  9. #9 by calvicie de patron masculino on 24 de março de 2017 - 4:44 am

    Isso porque a oleosidade excessiva facilita a aumento de
    fungos, causa coceira, descamação do couro cabeludo, que prejudica os cabelos
    e faz cair.

  10. #10 by Travel & leisure on 24 de março de 2017 - 4:48 am

    This is really interesting, You are a very skilled blogger. I have joined your feed and look forward to seeking more of your excellent post. Also, I’ve shared your site in my social networks!

  11. #11 by tinder dating site on 24 de março de 2017 - 4:51 am

    Terrific Web page, Maintain the excellent job. Appreciate it!
    tinder dating site http://t.co/H0HD1XBgQ3

  12. #12 by Travel & leisure on 24 de março de 2017 - 4:55 am

    Thanks a lot for giving everyone an extraordinarily memorable chance to discover important secrets from this web site. It is usually very brilliant and as well , packed with fun for me and my office colleagues to search your blog nearly thrice a week to read through the fresh issues you have. And of course, I’m so certainly fulfilled considering the great points you serve. Selected 3 areas in this post are without a doubt the most impressive we have all ever had.

1 1.501 1.502 1.503
(não será publicado)