These are chat archives for ZaneDubya/UltimaXNA

26th
Nov 2016
Zane Wagner
@ZaneDubya
Nov 26 2016 00:26
As I'm reacquainting myself with the codebase after my absence since earlier this year, I'm finding that the code is in need of cleanup in a big way.
#463 is another step in the direction of making the code a lot cleaner.
https://github.com/ZaneDubya/UltimaXNA/blob/master/dev/UltimaGame.cs is now much easier to read - all the cruft has been eliminated or moved to support classes.
I'll continue cleaning up as I have time.
After all the Milestone 0.8 issues are complete, I'll probably do a batch fix of all capitalization, organization, and style issues.
Four big style changes I'm considering:
  • Egyptian brackets throughout
  • Change prefix of private member variables from m_ to simply _
  • Require brackets on single line statements.
  • Soft limit of 120 characters in a single line for 99.9% of statements.
Zane Wagner
@ZaneDubya
Nov 26 2016 00:47
And I have some ideas that will hopefully reduce the time spent drawing by a good amount.
Optimizations.
Toni Spets
@hifi
Nov 26 2016 05:05
+1 for _members
makes auto-completion also easier
Zane Wagner
@ZaneDubya
Nov 26 2016 15:08
@hifi merged your portable TileMatrixData reading PR. Do we need to replace all the methods in NativeMethods?
Or - not replace - I'd rather just make portable versions. But same question.
Toni Spets
@hifi
Nov 26 2016 15:09
It was the only method used after I replaced all input handling
Zane Wagner
@ZaneDubya
Nov 26 2016 15:09
Ah, ok
My changes SHOULD work on your end. I can't see why they wouldn't. MG should not define WINDOWS on the linux / mac platforms.
Toni Spets
@hifi
Nov 26 2016 15:09
I don't know what to do with the input handling just yet
ideally it would have a portable implementation and native implementation(s)
Zane Wagner
@ZaneDubya
Nov 26 2016 15:10
Yeah, it's a beast. I spent many days trying to figure out how to handle different culture inputs.
I have no idea how nix handles keyboard<->text input.
Toni Spets
@hifi
Nov 26 2016 15:10
where native implementations would be on-par with the windows one and portable some weird keyboard mapping thingy
because I would be just fine with the "portable" one I'm not too eager to go that route yet (native on Linux or Mac)
Zane Wagner
@ZaneDubya
Nov 26 2016 15:12
I hear ya. Maybe just use the built in xna keyboard routines? I think we've talked previously how xna keyboard input is not optimal for typing text because the rate of input is not granular enough, but it's good enough for everything else.
But then again, it's been so long since I tried to use xna for that purpose. I might have been doing it wrong.
Toni Spets
@hifi
Nov 26 2016 15:16
xna input has no notion of keyboard layout
or any text input at all, you either need to emulate it or use the MG add-on for text input events
Zane Wagner
@ZaneDubya
Nov 26 2016 15:17
gotcha
Toni Spets
@hifi
Nov 26 2016 15:18
the problem with UXNA is all input handling is so tied to win32 way of doing things
it would be much better if it was abstracted away and the input system be pluggable for this kind of thing
there were also quite a lot of code in the event system of uxna I didn't really understand why it was there in the first place
Zane Wagner
@ZaneDubya
Nov 26 2016 15:20
Which event system? You mean the KeyboardEvent, etc code?
Toni Spets
@hifi
Nov 26 2016 15:20
it seemed overly complex
Zane Wagner
@ZaneDubya
Nov 26 2016 15:20
Mindlessly byzantine.
Toni Spets
@hifi
Nov 26 2016 15:20
the InputManager class mostly
Zane Wagner
@ZaneDubya
Nov 26 2016 15:20
Lol, so, the backstory on that...
Unless it has been tidied up, InputManager would have been some of the first code I wrote in c#!
Back in 2009.
Toni Spets
@hifi
Nov 26 2016 15:21
my InputManager is much more streamlined so I wondered if there was some reason for the complexity :p
Zane Wagner
@ZaneDubya
Nov 26 2016 15:21
So I wouldn't be surprised if it is... suboptimal.
Toni Spets
@hifi
Nov 26 2016 15:22
I don't assume anything in UXNA to be inheretly bad so I always try to reason with the code
maybe I should'nt ;)
Zane Wagner
@ZaneDubya
Nov 26 2016 15:23
That's very charitable of you, and I appreciate it. But 85-90% of it was written as a sort of learn-as-I-go project.
Most of the classes in the Ultima.World namespace - like WorldClient, WorldModel, the cursor classes... they all need some tidying up as well.
But they work now. I'm hesitant to refactor anything that doesn't need it now.
I'd be interested in seeing what you've done with InputMgr -- link?
Is it in your repo?
Toni Spets
@hifi
Nov 26 2016 15:24
yes
the input code isn't finished at all, text input mostly
but the input manager seemed ok what I wrote to do what I needed it to do
playing diablo 2 atm so a bit busy
Zane Wagner
@ZaneDubya
Nov 26 2016 15:25
k
no worries
Toni Spets
@hifi
Nov 26 2016 15:25
goddamn 800x600
Zane Wagner
@ZaneDubya
Nov 26 2016 15:25
great game! stole an entire summer of my youth ;P
Toni Spets
@hifi
Nov 26 2016 15:25
started playing it with my wife
we don't have much common games
though not on bnet, just lan
Toni Spets
@hifi
Nov 26 2016 15:32
also disclaimer on my inputmanager: it wasn't finished and there are some kludges still in there IIRC
Taras Polishchuk
@wake-up-neo
Nov 26 2016 20:00
Hi all. Wow, Zane starts to work on a client again
Taras Polishchuk
@wake-up-neo
Nov 26 2016 20:05
Currently I have a version from January and can't just merge it with the new updated, considering refactoring to VS2015. There was a bug with disposing of subcontainers when closing parent container. Also there was no disposing of container when character starts moving (e.g. close bank container). Also there was no normal dispose of containers, paperdolls when character were killed. I need time to reconfigure the environment and merge our shard specific fixes and check how it is now, so I just want to ask - did you know about this bug and maybe you had a chance to fix it? @ZaneDubya
Zane Wagner
@ZaneDubya
Nov 26 2016 22:05
Hey taras
I may have fixed that issue but I can't remember. If you feel that it is Worth looking into - and I'm sure it is - please post a pull request to my repo. Even if there is a lot of changes, I am pretty positive I can quickly merge in master and work with your improvements.
I do remember that issue, though.
I am always happy to look at submissions :)