Skip to main content

News

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Fat Cerberus

2851
Yeah, its main purpose is so that you can do stuff like this:
Code: (csharp) [Select]
var dict = new Dictionary<string, ReallyLongGenericName<SomeType, SomeOtherType> >();


Obviously that was an exaggeration, but yeah, the variable is still strongly typed, it just makes the declaration cleaner when using complicated types.
2852


I forget, does C# have implicit variable casting?


If the type were 'var' (like in JS) it is weakly typed and will implicitly cast between strings, integers, etc.


This is incorrect, all variables in C# are strongly typed, var merely instructs the compiler to figure out the type itself based on the rvalue instead of explicitly specifying it.  So if you do:
Code: (csharp) [Select]
var foo = "maggie ate it";


foo is then defined to be a string variable. You can't later assign a different type of value to it, the compiler will give you an error.  I think you're thinking of dynamic, which is a different beast entirely (used to implement duck typing).
2853
By default, widening conversions (float to double, int to long, etc.) are implicit; any conversion that could lose information, however, must be cast explicitly.
2854
Engine Development / Re: TurboSphere
Does the OpenGL plugin for TS fix the off-by-one errors in 2X scaling mode? That's my only issue with it in 1.5, it causes one-pixel gaps to appear between adjacent objects.
2855
Game Development / Re: The Screenshot Thread
Nothing special, just showing off my textboxes and menu strips for Spectacles.  I've been trying for a minimalist design for Specs; really helps the atmosphere in my eyes, a more graphical approach would be out of place with Specs having as much emphasis on its story as it does.
2856
Libraries / Re: Scenario 3.1
Scenario 3.1 has been released.  A couple breaking changes in this one, might want to check the changelog before upgrading any existing projects! :)
2857
Projects / Re: Spectacles: Bruce's Story
So I've been working on this at a pretty steady pace. If you look at my commit history a lot of it is just big fixes and tweaks, but I've also perfected the textbox system, and implemented menu strips, which will be used all over the place in the game. I plan to release a proper tech demo at some point, but that requires implementing the battle system, something I've been putting off for far too long.

Speaking of the menu strips, anyone want to check the code out of the spectacles-i repo and let me know what you think of those (and the textboxes as well, while you're at it)?  I'm rather proud of my minimalist UI design, but I was curious what everyone else thought.
2858

The neat trick here, is that the IPluginHost can cast between IPlugin and IEditorPlugin whenever it can. That means IPlugin is all that needs to be relied on. The only limitation is that it's the hosts job to cast between the types so sadly it must know that beforehand which means you can't create your own plugin on the fly. But have no fear, I'll be developing various interfaces to facilitate the need to have subplugins and so on.


Egh, this usage of casting is very hackish if I'm understanding it right, and having the host need to be pre-programmed to know which plugins are which types is very ugly, and actually destroys most of the advantages of having plugins in the first place.  There must be a cleaner way to do this...

Also Radnen, I sent you a pull request to fix the x86/x64 build options (all the projects weren't being built), want to check it out for me?
2859
Off-Topic Discussions / Re: C#/C plugins for Sphere
I have to say, I'm not liking this whole fat plugin idea.  It's great from the point of the view of someone using the editor, as they can just install one DLL and have it automatically work in the engine, but the issue comes with distribution.  When I go to distribute my game, do I really want to add bloat by including design-time code with the engine?  Probably not.  Let's not forget that more code is usually needed for the IDE side than the engine side...

This is one of the reasons recent versions of Visual Studio actually seperated the design-time components from the runtime stuff, to reduce the size of the redistributables.
2860
Projects / Re: Spectacles: Bruce's Story
I made a repo for Spectacles on GitHub if anyone wants to check it out:
https://github.com/powercommand/spectacles-i

You can run it, but right now it's little more than a tech demo for the textbox system and Scenario, and it doesn't even really leverage the full power of the latter yet.
2861
I don't know if I would split out the script editor myself--just sounds pointlessly idealistic for no real gain. The main strength of plugins is that you can pick and choose which ones you want to use based on your needs, but I can't think of a single use case where it makes sense to disable the script editor!  ???
2862

For the old editor's font-to-RFN, I was mostly fine with changing Windows' rendering settings before conversion. If you're going to force a particular rendering method in the conversion I really think you should allow the user to choose the setting (even through a simple toggle) instead of forcing one (the Adobe Font Folio version of Helvetica Neue, for example, will almost always look better at small sizes when rendered with anti-aliasing instead of turning it off; don't know if Adobe or Linotype updated the hinting since, but at least until Font Folio 11 this is the case).

Keep in mind that allowing certain methods of anti-aliasing may not be supported outside of Windows. This is where something consistent like FreeType would come in handy, and if I ever add font conversion to my phoenix-based app I'll use it myself.


Antialiasing is one thing; you never want ClearType used for a TrueType-to-raster conversation, however, as the conversion invariably looks like crap if rendered at a different resolution or on a different background.  ClearType is something that has to be done in realtime for it to work as intended.  And we can't exactly ask every Sphere user to turn it off manually when generating fonts for Sphere!

Also, the method I figured out for doing this is a standard part of the .NET framework (specifically, the System.Drawing namespace), so there's no reason it shouldn't work in, e.g., Mono.  So I wouldn't be too worried about cross-platform issues in this particular case.
2863
One minor change to make it perfect: Change that from SingleBitPerPixel to SingleBitPerPixelGridFit.  The latter uses hints in the TT file to make the resulting text look much, much better.

Edit: Hm, looks like characters are being cut off due to not enough space at certain point sizes.  I think I'll experiment some more and see if I can fix all the bugs... :)
2864
Sleep is overrated... I figured out how to solve the ClearType issue without changing the OS settings:
Code: (csharp) [Select]
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixel
2865
One more bug report, then I need to get some sleep: If two files have the same filename and you have one of them open, Sphere Studio gets confused if you try to open the other and just switches to the existing tab, even when the files are in different folders.

Oh, and you're not supposed to commit the .csproj.user files!  Those are machine-specific I believe, similar to the hidden .suo file but at the individual project level instead of the solution.