Jump to content
  • Advertisement

Injur Fejis

  • Content Count

  • Joined

  • Last visited

Community Reputation

154 Neutral

About Injur Fejis

  • Rank
  1. Injur Fejis

    Digital Trading Card Game / MMORPG Project

    Hm okay that sounds pretty nice. The graphical execution is pretty good anyway ...   Just looking at that featurelist and it being an MMORPG I'm really looking forward to it.   Even more so if it 's based on a nice story, which is something most MMORPGs always struggle with - and that Introduction sounds promising to me.   Ai, can't wait!
  2. Injur Fejis

    Digital Trading Card Game / MMORPG Project

    I quite like the cards, the low saturated setting and the somewhat unique style they give of . However the colors and the style of the game and avatars itself seem a bit to flashy, shiny and cute to me personally. It feels like it is two different worlds are mixing - the former being more mature then second being more fresh and youth like. If I had to give an example in terms of target audience - mixing Magic the Gathering with Zenonia or even more extreme - Animal Farm (just as an example).   It wouldn't have been to bad to see something different to the usual in the game world as well instead of just the same old thematic that repeats itself time after time especially since the cards have such an unique design! I was kinda expecting something like the tron world (just an example). Yes you can mix absolutely different worlds if it 's a game in a game but that doesn't mean it might still leave a shallow feeling behind it, like you were to scared to follow an unusual attempt or were trying to much to into two directions at the same time.   That goes without saying that 's only about the overall art-style and feeling to it - and not the gameplay itself.   Looking forward to trying it out anyway.   Cheers!
  3. Thank for very much for the link to L. Spiro 's explanation - and your additions to that as well!    I think it finally snapped to me how it works. It also has some fine nuances I would like to know so I'll be sure to study it properly before continuing further. Glenn Fiedler 's one is great in itself but a bit to specific aimed towards physics and to abstract with it 's example for me (variable names and methods in itself) unless you followed his whole tutorial series about physics which is something I'm planning to do at a later state after grasping the basics.   I would define properly as to understanding properly myself I know there 's no perfect solution out there. Properly just means to me that I know as to what and how I'm doing something (to some extend).   Cheers!
  4.   Well you're true. That was just stupid of me I guess first converting it into MS and then back into seconds even when I'm using a double which should be accurate enough. Talk about needlessly converting stuff back and forth. Thanks for pointing that mistake out.     Thats also a good call. I don't think it 's possible as the time between Stop and Restart should be well within nano seconds as nothing more is done then 2 variables are set so I guess I'll have to live with that small inaccuracy. If I don't stop it beforehand FrameTime and LastUpdated might hold slightly differencens which I don't want.     Basically I want to make sure my RenderLoop runs properly, my Animations are smooth and running at the Time I've intended them to run independent of the FPS. And that I can grasp the logic behind it and not just use an existing mechanic / derivate without understanding it properly since I don't like to do stuff I don't understand.    Most of the examples I found (here as well) only show halfway trough and don't provide an basic example of Update() and Draw() with an simple animation - just a call to them - so they're hard to understand and rebuild properly (at least for me).   If it might help I could upload the complete Project (Mono/Xamarin Studio) - I'm planning to make it Open-Source anyway.   Cheers!
  5.   That 's right. I understood it will always run on the Monitors Refresh Rate. I'm not trying to force it otherwise. Callling it "Fixed-FPS" might have not been right in that case - I just didn't know the correct terms. I'm not looking into putting it into max performance as it should take as little resources as possible with it being a helper utility that 's also why I thought binding it to the Refresh Rate / Enabling VSYNC should be better then letting it run at ~1000 FPS+ freely. The former took around ~20%+ CPU (i5 @ 4GHZ) while the last one is just taking ~2-8% on average (at least that 's what the Taskmanager said).       Now that 's interesting. I've read about how you make it (=Animations) time based "easily" in a Frame based RenderLoop but I don't get the logic behind it just found many different examples that 's why I've tried to come up with a logical way that I can understand (formula) rather then just using something. Can you give me an simple example (doesn't have to be complicated) and explanation how you would do it? Can be pseudocode as well or even a link to an simple example project (C#) I just have to grasp the logic I guess.   I just want to be sure to understand the basics properly before moving forward to fast and building onto practices I can't explain.   Thanks for looking into my stuff and have a nice day!   Btw.: The timer is stopped and tracked on the beginning on each frame so it 's measuring the time it took the last frame to render right now.
  6. Injur Fejis

    Web Programming Proffession [ Need Advice] -

    OT - taken PHP aside:   As if Facebook is the de facto standard of good coding practices to begin with.   They're always hacking stuff around - heck look at their messed up API and even their iFrame-Widgets change without any warning with little care about the Developers at all -  "eat or die" - resulting in borked up and broken stuff over and over again over the years ... no Facebook is certainly not a good example when speaking about good coding practices one should follow.
  7. Injur Fejis

    Web Programming Proffession [ Need Advice] -

    In the end singular opinions about the market are useless anyway. Getting an overview of the whole market in itself is difficult for a single person and you can't certainly argue about it without hard evidence collected over the years in numbers from reliable sources. And even then it would be like foreseeing the stock market - which is objected to change at any time or not because the delivery of 200.000 tons of oil failed or the next war broke out or someone forgot to flush the toilet / variable and interpreted it differently.   Fact is - the market for PHP is there. PHP exists since almost 20 years and it 's certainly not going to vanish with it being Open-Source and free. The things that more likely tend to vanish over the years again and again are Closed-Source attempts by companies like for example Macromedia (Flash) or Quark (QuarkXPress). And even the former still holds some grasp and kind of finds itself a niché of which it can still continue without being completely extinct.   Open-Source will exist as long as the Source is still out there in any form which anyone can grab and improve or rewrite how they like it or think it should be.   In the end post #2 by @superman3275 basically already said everything that needed to be said.   It 's up to the cdosrunO1 now to get started and decide for himself and this discussion as to how good PHP is or if it 's vanishing or not is rather working against him just starting and experiencing stuff for himself as it might make him unsure about where to start instead of just starting and in the end it results wasting way to much time thinking about "if" "could be" or "optimal" solutions.   @csdosrunO1: Just start - go out and find your own way. That 's all I can say. Don't spend your time over-thinking and over-discussing stuff.   Cheers!     Ah, and ... downvotes are ment for trolling posts, spam and the like are they not? If you need to result to downvote regular posts that says something about your own person.  
  8. *half as fast in terms of pixels per step of course and the same in terms of time. right? Sorry I'm to scared to update my last post because somehow the forum messes up all the linebreaks at each time.
  9. Good call. I've looked up IDXGISwapChain::Present on MSDN and it seems you're right. One thing I forgot to include is my SwapChain creation:   public virtual void CreateSwapChain() { // SwapChain description var desc = new SwapChainDescription() { BufferCount = 1, ModeDescription = new ModeDescription(renderForm.ClientSize.Width, renderForm.ClientSize.Height, new Rational(60, 1), Format.R8G8B8A8_UNorm), IsWindowed = true, OutputHandle = renderForm.Handle, SampleDescription = new SampleDescription(1, 0), SwapEffect = SwapEffect.Discard, Usage = Usage.RenderTargetOutput, Flags = SwapChainFlags.None }; // Create Device and SwapChain Device1.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.Debug | DeviceCreationFlags.BgraSupport, desc, FeatureLevel.Level_10_0, out device, out swapChain); }   What I intended right now is using the time it took the last frame to render to Interpolate the animation itself which is made with 60FPS at mind (fixed value)   I'm doing the Interpolation (is this the correct word?) like this:   double animationStep = (double)animateMyTest.GetStep(); double correctedStep = animationStep * ((_frameTime/1000)*_FPS); animationStep is a single step per frame in pixels at the optimum of 60 FPS. I take that value divide it by the frameTime (which is like I said the time the previous frame took to render in MS) and multiplicate it at the Animations intended FPS (60 which I'm working with). Since my targeted audience will high likely include gamers using 120hz monitor they should get 120FPS so in that case let me provide an example how it would work:   The user/gamer is using an 120hz Monitor so lets he has 120FPS (optimally) which would equal in an FrameTime of 8,3333~ ms so let 's say _frameTime would be 8,3333 in that case I divide that time by 1000 (to get it into seconds) and multiplicate it by the targeted FPS of 60 which would get me an modificator of 0.49998 meaning one step would be about half as fast as it would be running with 60 FPS.   animationStep = 100; //pixels per frame moved at 60 FPS correctedStep = 100 * ((8.3333/1000)*60); correctedStep = 100 * 0.49998; correctedStep = 49.998; //pixels per frame moved at 120 FPS   ... which sounds logical to me. Is everything correct here or did I make a misstake somewhere or is there a better way to implement this?
  10. Injur Fejis

    Web Programming Proffession [ Need Advice] -

    Just to add to the point - PHP is indeed important to learn and a good starting point. Just think about the various Content-Manager-Systems out there ...   WordPress Contao TYPO3 Joomla Magento ... Heck even the most well known Open-Source Forums use PHP don't they (didn't bother with any of them since a long time)?   Coding an small Plugin / Extension for any of those is both a good learning point as well as might generate some money if you really find something that are not existing. The good thing is - those are not even Open-Source and free but they're widely used giving you an larger audience and possibly some small Jobs that help you moving forward.   However I also second that HTML5, CSS3 and Javascript/jQuery Knowdlege should be equally important in getting to know with.   Python, Perl and the like are certainly lovable as well especially as those are closer to the Unix-Feeling and integrate with many Tools and Environments easily or how should I say it... er ... whatever. I'd still place them third just closely behind the others ... HTML5, CSS3, jQuery/Javascript PHP, SQL Python, Perl and the like. Keep in mind that you can work/learn Multi-Threaded  and not only Single Threaded. Just don't use to many Cores, give them proper Priorities and let them shift from time to time.   Edit:   5am time to sleep.   Text sounds weird. Whatever :D 
  11. Hi there,   I'm pretty new to DirectX, Direct2D and C#-Development in General (not to Development in itself) so excuse me if there are any oblivious flaws.   The attached tags should give an rough overview about the Environment I'm using (or at least I hope so ).    My SharpDX-Application is using DirectX10 combined with Direct2D in a SwapChain. I'm mostly drawing 2D UI-Stuff in Direct2D (the Application isn't a Game in itself but a Helper enabling Steam In-Home-Streaming for the Windows Desktop) however I might implement a few DirectX effects later on if I find time or patience to do so. Well let 's say I've just finished the first Prototype for my Animation Class so everything is in a pretty early stage. Sorry for the long introduction I'll show you my code that is important in getting accurate answers concerning my questions next   This is my RenderLoop and the most important methods build around it:   public virtual void Initialize() { } public virtual void LoadContent(){ } public virtual void UnloadContent() { } public virtual void RunOnceBeforeRender() { } public virtual void RunOnceAfterRender() { } public virtual void Update(int fps, int cpu, double frameTime) { } public virtual void Draw(int fps, int cpu, double frameTime) { } public virtual void BeginFrame() { Application.FPS.Frame(); Application.CPU.Frame(); Application.Timer.Frame(); // <- RenderTime gets updated here } public virtual void EndFrame() { swapChain.Present(1, PresentFlags.None); } public virtual void Run() { Initialize(); LoadContent(); //Reminder - http://gafferongames.com/game-physics/fix-your-timestep/ RenderLoop.Run(renderForm, () => { if(bRunOnceBeforeRender == false) { RunOnceBeforeRender(); bRunOnceBeforeRender = true; } BeginFrame(); // <- Update FrameTime if(!renderForm.isResizing && renderForm.hasSizeChanged) HandleResize(); Update(Application.FPS.Value, Application.CPU.Value, Application.Timer.FrameTime); Draw(Application.FPS.Value, Application.CPU.Value, Application.Timer.FrameTime); EndFrame(); if(bRunOnceAfterRender == false) { RunOnceAfterRender(); bRunOnceAfterRender = true; } }); UnloadContent(); Dispose(); } public virtual void Dispose() { Utilities.Dispose(ref backBuffer); Utilities.Dispose(ref renderView); Utilities.Dispose(ref d2dRenderTarget); Utilities.Dispose(ref surface); }    I limit the FPS to 60 (VSYNC enabled) via   swapChain.Present(1, PresentFlags.None);   in EndFrame()   (double) RenderTime (= Time in MS the last Frame took to Render) gets updated at the start of each next frame here BeginFrame():   public virtual void BeginFrame() { ... ... Application.Timer.Frame(); // <- RenderTime gets updated here }   The Frame() method that stores the time since the last frame got drawn looks like this:   public void Frame() { _StopWatch.Stop(); FrameTime = (double)_StopWatch.ElapsedTicks/(Stopwatch.Frequency/1000); LastUpdated = Stopwatch.GetTimestamp(); //if(FrameTime > 250) FrameTime = 250; // Set Maximum Frametime to 250ms _StopWatch.Restart(); } As you can see I'm using StopWatch due to the QueryPerformanceCounter/QueryPerformanceFrequency implementation for a High Resolution Timer.    Here comes my first question:   FrameTime = (double)_StopWatch.ElapsedTicks/(Stopwatch.Frequency/1000);   Is the calculation / storage of the FrameTime ok like this? Could it be optimized in terms of speed or reliability (both in terms of reliability and performance)? What I'm planning to add is limiting the maximum FrameTime to 250ms just in case I get ridiculus amounts of Frameskips.   Now lets move onto the topic of Animating stuff with the above Environment (Target FPS of 60, Time since last frame stored as double).   Like I said in my Introduction above I've written my first Prototype of my Animation class called PropertyAnimation since it 's aimed at animating any Numeric Property of any Object.   It 's not yet finished as in the Draw()/Render()/Update() Methods are still missing but the rest is already there for which the most important part for me is the calculation of the single steps with the targeted FPS and aimed animation time. The single step itself is returned with the method GetStep().     public object GetStep() { double step; step = (_to-_from)/(_durationS*_FPS); return step; }   using all of the above this is what I'm logging with my Application with a sample Animation Testcase with the following Code:   public class TestObject { public int width = 100; public int height = 100; } if(Log.IsDebugEnabled) { Log.Debug("Average FPS: " + FPS.AVG.ToString()); Log.Debug("Min FPS: " + FPS.Min.ToString()); Log.Debug("Max FPS: " + FPS.Max.ToString()); Log.Debug("Last FPS Value: " + FPS.Value.ToString()); Log.Debug("Last FrameTime is "+Timer.FrameTime.ToString()); TestObject myTest = new TestObject(); //animateMyTest.SetValue((int)400); string msg = "\n\n=== Test Animation Data ===\n"; double toValue = 500; long timeInMS = 2000; int _FPS = 60; PropertyAnimation animateMyTest = new PropertyAnimation(myTest, "width", toValue, timeInMS, 60); double _frameTime = Timer.FrameTime; double animationStep = (double)animateMyTest.GetStep(); double correctedStep = animationStep * ((_frameTime/1000)*_FPS); msg += "\n Animate From => " + animateMyTest.GetValue().ToString(); msg += "\n Animate To => " + toValue.ToString(); msg += "\n Within MS => " + timeInMS.ToString(); msg += "\n Target FPS => " +_FPS.ToString(); msg += "\n Animation Step => " + animationStep.ToString(); msg += "\n Step FPS-Corrected => " + correctedStep.ToString(); msg += "\n\n==========================="; msg = msg.Replace ("\n", System.Environment.NewLine); Log.Debug(msg); }   ... which is giving me the following Debug Output:   2014-07-30 02:56:42,753 [DEBUG] Average FPS: 55 2014-07-30 02:56:42,753 [DEBUG] Min FPS: 28 2014-07-30 02:56:42,753 [DEBUG] Max FPS: 60 2014-07-30 02:56:42,753 [DEBUG] Last FPS Value: 60 2014-07-30 02:56:42,753 [DEBUG] Last FrameTime is 16,766265060241 2014-07-30 02:56:42,753 [DEBUG] === Test Animation Data === Animate From => 100 Animate To => 500 Within MS => 2000 Target FPS => 60 Animation Step => 3,33333333333333 Step FPS-Corrected => 3,35325301204819 ===========================   Here comes the second question:   To me, as a beginner in Frame-Dependent Developing with DirectX/D2D and similiar everything looks ok. However I'm wondering if I understood the principles of the FPS-Correction of the Animations with the Frame correctly (that 's called Interpolation right?). As in -   if my interpolation / correction calculation is correct, efficient and reliable enough to be called at each frame:   //GetStep() = (_to-_from)/(_durationS*_FPS); double _frameTime = Timer.FrameTime; double animationStep = (double)animateMyTest.GetStep(); double correctedStep = animationStep * ((_frameTime/1000)*_FPS);   Wow, ok I hope i didn't forget some important stuff, and my questions make sense for them to get answered. Like I said sorry if I'm grasping something wrong I just started C# 5 days ago and this is what I've come up with up to now. Cool that you took the time to read my thread - I'm welcoming any constructive feedback and of course absolutely anything that can provide towards solving my questions. Sorry if the post itself is rather long - I tried to be as specific as I could.   Cheers!   Simon   I've attached the PropertyAnimation class just in case any questions arise towards any specific functions.
  12. Injur Fejis

    What happened to Rastertek?

    Just in case -> https://rastertekdx.codeplex.com/SourceControl/latest   This has (almost) all rastertek tutorials written with SharpDX in C#   Cheers! :)
  13. Injur Fejis

    Animation timing. (SharpDX)

    Just incase someone has the same difficulties I've encountered - I've used several other Timers including Systems.Threading.Timer - but all of them were executed in a seprate Thread and led to an Thread access violation when for example changing the WinForm-Size out of the Timer-Event (yea I know I should do that in my Main-Render). I'm using System.Windows.Forms.Timer and it works flawlessly for me as it get 's the correct Thread Reference to the WinForm.   It 's in german but here 's a Wrapper-Class using System.Windows.Forms.Timer and QueryPerformanceCounter/Frequency (Post #4) including some additional info (if you can read german or am able to use Google Translate):   http://www.mycsharp.de/wbb2/thread.php?postid=3635578   Cheers!   Edit:   Just in case I've translated the class from Peter Bucher in English for non-native German speakers. All credits go to him! Excuse me if it isn't 100% accurate, I've translated it quick n' dirty and removed 1-2 comments as I didn't found them usefull/obsolete! using System; using System.Runtime.InteropServices; using System.Collections.Generic; namespace SharpKrush.Misc { /// <summary> /// Returns the FPS value, which is been updated at an interval/tick /// </summary> public class FrameCounter { [DllImport("kernel32.dll")] private static extern bool QueryPerformanceCounter(out long lpPerformanceCount); [DllImport("kernel32.dll")] private static extern bool QueryPerformanceFrequency(out long frequency); private System.Windows.Forms.Timer _timer; private float _fps; private float _avgFps; private float _minFps; private float _maxFps; private float _sum; private float _sumCount; private float _actFps; // current FPS (after Render Timing) private long _lastFrame; private long _freq; private long _currentFrame; private int _interval; /// <summary> /// Constructor /// </summary> /// <param name="interval">Interval of the FPS-Update in Milliseconds</param> public FrameCounter(int interval) { this._sum = 0f; this._sumCount = 0f; // Min- and Max-FPS values this._minFps = 999; this._maxFps = 0; this._timer = new System.Windows.Forms.Timer(); this._timer.Start(); this._timer.Tick += new EventHandler(this.OnTick); this._timer.Interval = interval; } /// <summary> /// Returns the FPS-Value /// </summary> public float Fps { get { return this._fps; } } /// <summary> /// Returns the Average FPS /// </summary> public float AvgFps { get { return this._avgFps; } } /// <summary> /// Returns the Lowest FPS /// </summary> public float MinFps { get { return this._minFps; } } /// <summary> /// Returns the Biggest / Maximum FPS /// </summary> public float MaxFps { get { return this._maxFps; } } /// <summary> /// FPS-Update-Interval in MS /// </summary> public int Interval { set { this._interval = value; } } /// <summary> /// Start the timing /// </summary> public void Begin() { QueryPerformanceFrequency(out this._freq); QueryPerformanceCounter(out this._lastFrame); } /// <summary> /// Calculates the current FPS after Rendering /// </summary> public void End() { QueryPerformanceCounter(out this._currentFrame); this._actFps = this._freq / (this._currentFrame - this._lastFrame); // Check if FPS is lower then previous Minimum-FPS if (this._actFps < this._minFps) { this._minFps = this._actFps; } // Check if FPS is bigger then previous Maximum-FPS if (this._actFps > this._maxFps) { this._maxFps = this._actFps; } } /// <summary> /// Generates the Average FPS /// </summary> private void CalculateAvgFps() { if (this._sumCount <= 600) { this._sum += this._fps; this._sumCount++; this._avgFps = this._sum / this._sumCount; } else { this._sum = 0; this._avgFps = 60; } } /// <summary> /// After each Timer-Interval the FPS-Value will be generated here /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnTick(object sender, EventArgs e) { this._fps = this._actFps; this.CalculateAvgFps(); } } }
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!