Outpost Universe Forums

Off Topic => General Interest => Topic started by: Hooman on May 21, 2017, 02:05:36 PM

Title: Remote Pair Programming
Post by: Hooman on May 21, 2017, 02:05:36 PM
Would anyone here be interested in trying out remote pair programming? (As in screen sharing + Skype or similar). I'm thinking something informal, just to play with the concept and some tools.

If so, reply with a suggested date and time (including time zone).
Title: Re: Remote Pair Programming
Post by: White Claw on May 21, 2017, 04:45:33 PM
I've done this in the past, but right now would be tough for me. I'm in the process of moving, so my days are chaotic at the moment.

Personally I've had better luck with Google Hangouts than Skype for screen sharing and multiple participants. I think Slack has something as well, but their app requires a bit more setup.

In either case, what is the topic of interest? OP2 programming, or do you have some other thing in mind?
Title: Re: Remote Pair Programming
Post by: Vagabond on May 21, 2017, 10:14:40 PM
Hooman,

Do you mean Pair Programming as described in Agile Software Development? https://en.wikipedia.org/wiki/Pair_programming

I would be interested in participating. I'm proficient in C# (for a hobbyist anyways) and get around enough in C++ to code the Outpost 2 levels. Any other language and it would probably turn into more of a teaching session than me actually contributing.

I've done some game jams before where myself and 2-3 other people get together and work on programming a game together. Typically a clone of an older game. We throw up a list of feature for the game on a Trello board (https://trello.com/) and then each pick a feature to work on. We typically start from scratch and work for a day on it to see how far we can get. In the beginning you step on each other a lot because the code base is small. So it requires someone being pretty good with revision control to sort things out if 2 people end up modifying the same area in code simultaneously. I think this is different from Pair Programming though since we are all typing code simultaneously. In Pair Programming, only one person is typing, while the other is reviewing/suggesting strategies/planning ahead right?

How long are you thinking for the session? A couple of hours? We should probably pick some sort of topic/goal for it as well though? Maybe something that could be completed at least in rough form in a single session?
Title: Re: Remote Pair Programming
Post by: Hooman on May 22, 2017, 07:45:05 AM
Quote
Personally I've had better luck with Google Hangouts than Skype for screen sharing and multiple participants. I think Slack has something as well, but their app requires a bit more setup.

See, this is the kind of stuff I need to figure out. There are a ton of different software setups to do this sort of thing. The only way to really know what works well is to try a bunch of them out. It will depend on the task at hand too. Some people use Remote Desktop for Windows and might perhaps code in Visual Studio, other people might use "screen" in a shared terminal on Linux and code in "vi". One person might host the session, or the session could be hosted on a server, perhaps even a temporary virtual machine from a cloud provider. Communication could be two way, or it could be a conference call. It could be voice only chat, or it could be video, and maybe that depends on bandwidth, or maybe that depends on screen space, or maybe that depends on privacy concerns and insecurities.

I don't really know what I'm going for at this point. I was thinking start with Remote Desktop for screen sharing, and Skype for voice. That could provide a baseline experience. Could take things from there and try out other stuff in the future.

Quote
In either case, what is the topic of interest? OP2 programming, or do you have some other thing in mind?

Honestly, at this point I'm more concerned about how to get a session going that what would actually be accomplished. I figure something OPU related would be obvious, but what exactly is kind of arbitrary. Could be working on a new level, hacking OP2, working on a remake project, website updates, extracting game resources, blender, or whatever people have interest in. I'm going to say making an OP2 level would be a nice default project.

Quote
I've done this in the past, but right now would be tough for me. I'm in the process of moving, so my days are chaotic at the moment.
See what you just did there? You expressed interest, but avoided commitment. Why? I'll give you a hint, it likely has nothing to do with moving. That's just the easy surface level excuse. Think what's behind your last question about what will be worked on. Is it perhaps more to do with concerns of not knowing enough, not being able to follow along, wasting someones time, or even just looking stupid? Yes, I just called you out on that. ;)


Quote
Do you mean Pair Programming as described in Agile Software Development? https://en.wikipedia.org/wiki/Pair_programming
Yes, that's exactly what I'm talking about.

Quote
Any other language and it would probably turn into more of a teaching session than me actually contributing.
That is one of the points of pair programming. It spreads information.

Quote
...I think this is different from Pair Programming though since we are all typing code simultaneously. In Pair Programming, only one person is typing, while the other is reviewing/suggesting strategies/planning ahead right?
Correct.

Quote
How long are you thinking for the session? A couple of hours? We should probably pick some sort of topic/goal for it as well though? Maybe something that could be completed at least in rough form in a single session?
I was thinking start with an hour, though maybe leave it open ended in case people want to continue longer. The first session will likely be more about fighting with tools trying to get it all working than actually accomplishing anything. A rough task of creating the start of a new OP2 level might be good.
Title: Re: Remote Pair Programming
Post by: White Claw on May 22, 2017, 06:25:59 PM
Quote
I've done this in the past, but right now would be tough for me. I'm in the process of moving, so my days are chaotic at the moment.
See what you just did there? You expressed interest, but avoided commitment. Why? I'll give you a hint, it likely has nothing to do with moving. That's just the easy surface level excuse. Think what's behind your last question about what will be worked on. Is it perhaps more to do with concerns of not knowing enough, not being able to follow along, wasting someones time, or even just looking stupid? Yes, I just called you out on that. ;)

Well, I am interested or I wouldn't have replied at all. You did call me out (and that's okay), but I also figure you aren't really interested in all of the excuses in your thread. It's not really that I'm moving but that I'm taking a new job, and moving to another state is part of that. I know my next job is going to be more demanding than my current, but I'm not certain how much more yet. So I'm avoiding commitment because what I DON'T want is to say "yeah, I'm in!" and then disappear for several weeks. Then come back and have no time for side hobbies while I settle into my new job. (In my opinion, that's a bit of a jerk move.) Also, in approximately a week I will be without internet connection for an indefinite amount of time (might be a week, might be a month).

We all only have so many hours available to us. So yes, on some level I'm a bit selfish and I'd like to know what's being worked on before I commit. I value my family and work time above my personal time, so I have to figure out what I'm "not" going to do in order to support another branch to my gaming hobby. Currently I've stopped programming in order to focus on improving my modeling skills. Also, my experiences over the last several years has proven to me that my timezone is often a hurdle. If you look at my user stats, you'll see a very distinct time frame of activity for me (when I'm not working or taking care of the family).

But really, I don't mean to hijack the thread. I am interested in discussing the possibilities of this thread and want to participate in seeing it come to fruition. I just can't give a solid commitment yet. Hopefully that makes sense.

Also, I'm not specifically familiar with "pair programming," but sounds like I might have done some simply in practice without knowing what it was called. Sounds kind of like the goal is that you're more interested in figuring out how to set all that up, and less concerned about the project itself?
Title: Re: Remote Pair Programming
Post by: Vagabond on May 22, 2017, 10:33:07 PM
Why don't we shoot for a 2 hour session for the first one? First hour to get a workflow going and the second hour for actually trying to do the pair programming.

I currently do not have a Linux machine, so would have to be on Windows for me to participate.

I would prefer either VS2015 or VS2017. The bulk of Outpost 2 stuff is already on VS2015, so maybe that makes the most sense? Or we could go with the newer version so it remains relevant longer.

If we stick to the Outpost Universe repository then I guess Subversion makes sense for the revision control. I am comfortable with Mercurial as well.

What about 1-3AM GMT Monday the 29th. That would be Sunday evening US Eastern Time. Not sure what time zone you are in Hooman. I could easily push that several hours later if it helps out?



My idea for the Pair Programming:

I would like to see a utility library for Outpost 2 related non-scenario tasks. Things like

1. Retrieving a list of filenames from a VOL file.
2. Adding a new file to a VOL file.
3. Removing a file from a VOL file.
4. Pulling information from a MAP file like height and width of the map and specific tile IDs.

I know a lot of these problems have been solved in the past, but I don't see their source code in the repository yet. (Maybe I'm just missing it). Basically I would like a library that could be used by Outpost 2 utilities to shorten and simplify their development time. I haven't found solutions to these problems posted in a way that I can digest without major research on my part.

Anyways, maybe we could pick a couple of processes out like processing the MAP or VOL file manipulation and try to write them into the library. I would lean towards the MAP file reading first, but maybe VOL would be easier to start with.

Thoughts? I had another idea if this doesn't sound appealing... Also happy to work on a new scenario as well, we just have to promise to finish it if we start it. :)

Part of my motivation is that I want to write a console program that can read the tiles from a .MAP file, select the proper tile from the BMP sprite sheet and then splice together an image of the map in variable sizes. I currently do not know how to access the data from the MAP file though, so it feels fairly out of reach for me to solve. Having a library that solved these tasks would be very helpful.
Title: Re: Remote Pair Programming
Post by: Hooman on May 23, 2017, 02:12:43 PM
@WhiteClaw: All very good reasons, especially the family time! The new job thing is also a big time concern, ... starting next week! Luckily, I'm impatient and want to do something this week. :D

As for time commitment, this doesn't need to be long term. It can be treated as a one-off, lets try this, ok, done.

As for your activity spike in your stats, it shows up as 8pm for me. That's hardly a problem.


@Vagabond: 1-3am GMT works for me, and yes I can do 2 hours. That's 9am-11am in my current time zone. Your activity spike in your stats is 1pm for me. I've marked your time in my calendar, though feel free to update if you chose a slightly inconvenient time thinking I was in a different time zone.

Your project ideas sound excellent. Even better than a new level. I'd actually also wanted to make a utility that can produce scaled images of maps. The VOL and MAP file processing code sounds like a good starter project that would lead into such a project. I also have a few other odd ideas such code could be used for.

I'm currently using Linux, though I've installed a remote desktop client that should allow me to connect to a Windows machine. Probably easiest if you host, though I can look into setting up a Windows virtual machine if you want me to host.

I suggest installing HxD (https://mh-nexus.de/en/hxd/) if we're going to do work with binary files. It's an awesome hex editor for Windows. It would allow us to look at the data and understand the format easier, before starting to write code. Optional though.

It might help to do an SVN checkout of the OPU repository. There is code and info in there we can likely pull as reference material.

I'm familiar with SVN and Git. There has been interest in moving stuff over to GitLab or GitHub, so that might be interesting to try, though I'm open to using Mercurial. That would be something new for me to learn. We could even try doing commits to more than one version control system and see what happens. :P
Title: Re: Remote Pair Programming
Post by: leeor_net on May 23, 2017, 07:24:28 PM
I've been wanting to do this with you since you PM'd me about it a couple of years ago... but I'm also an extreme introvert and am very nervous about using voice chat software. Not because of privacy reasons (don't care about that, i have nothing to hide) but because I'm very awkward and voice chat creates a much more personal connection vs. text chat.

On the flip side, it's a lot easier/faster to convey ideas via voice chat especially when it comes to an activity as difficult as programming.

To relate to another post (http://forum.outpost2.net/index.php/topic,5952.0.html), I would personally recommend Discord. It works so much better than skype and hangouts and is much, much lighter weight without advertisements and you don't have to install software to use it -- you can use the app through a web browser interface.
Title: Re: Remote Pair Programming
Post by: Vagabond on May 24, 2017, 01:34:02 AM
Leeor,

If there is a fourth person, we could setup two teams and switch team members for a second session. Or I don't mind bowing out of the first session and then participating in a second session maybe a week later if you want to jump in? I'm certain you can run circles around me in C++. No guarantees my children won't be arguing in the background during part of the session though. Perhaps my wife will be kind and take them out somewhere during the pair programming.


Hooman & Leeor,

Since we are working on Outpost 2 related code, I think it would make sense to push it all into the Outpost Universe Repository using Subversion. If we want to start corporately using GitLab or GitHub, I am happy with that though. Either way, I already have a copy of the repo checked out to my CPU. I'll grab the newest version this weekend.

I just downloaded and installed HxD. It is working opening random files, and seems to let me edit the files. Not sure how to use it gainfully though... If I have some time, I'll try to find a tutorial on using HxD or something in the next couple of days.

Can someone point me to an article or documentation on what you mean by remote desktop client and maybe how it is used in Pair Programming. I've never dealt with anything like this before. I was thinking screen sharing and pushing/pulling code through the repo when switching who is driving for the pair programming. Sounds like Hooman is talking about both people controlling the same computer.



Seems like we agree on making a utility library for Outpost 2 related tasks. I'm thinking C++ (happy to try a different one if desired though). I think programming a utility application is much quicker in C#, but C++ is probably easier for cross platform work and more member of the community have a working knowledge.

We will need some way to test the functions as they are written for the utility library. I'd rather not directly connect the library to an application. We could do 2 projects in the solution, the library and a simple test application project that references the utility library. Maybe the test application could be a simple console application. So you could type things like:

 * ADD Maps01.vol NewMap.map
 * READ Maps01.vol (lists all files in maps01.vol)
 * REMOVE Maps01.vol NewMap.map
 * TILEID NewMap.map 1,1 (returns proper tileset/tileID. not really sure how this is done by OP2)
 * MAPWIDTH NewMap.map (returns width of map in tiles)
 * MAPHEIGHT NewMap.map (returns height of map in tiles)

Nothing necessarily useful for the sample program, just prove the library is working and show a sample of its use. I would probably skip a lot of error handling and other things just to keep it simple, quick, easy to read, and easy to work on.

I'm not crazy about testing this way. Maybe there is a better way to test the library functions though. Unit testing or something else?

What about naming the library OP2Utility?

Also, I'm assuming so far one utility project. Would it make sense to have several smaller projects. Like OP2VolReader and OP2MapUtility instead of one project for all of it?

We should probably consider moving the details of the project into a separate forum thread and leave this thread for discussing the tool chain/dates/pair programming strategy.
Title: Re: Remote Pair Programming
Post by: White Claw on May 24, 2017, 01:43:46 AM
I don't know anything about the Discord chat, but google hangouts does not require additional software and adverts (at least not in my experience). You just log into google (I use chrome), start a hangout, then pass the link to someone and they can join. I'm not pushing for Hangouts, just saying that it's also web browser capable and pretty much only requires a google account.

I think the best time for me would be somewhere around 6-8am GMT (if I'm doing the math right).

Funny enough, I hadn't really thought about my profile spike time till I started doing the math. The time there actually corresponds to when I initially get home and have a chance to respond to any posts. I don't think it corresponds to when I actually might be free for an hour or so of computer time.

Saturday or Sunday are probably the only days where I might be able to swing something like this. My other evenings are already full. I'm not sure if I'm comfortable with someone remoting into my computer, but screenshare via something like Hangouts or whatever would be doable. Also, I'm quite introverted like Leeor. So I feel your pain there. It can take a little getting used to. I'm fairly comfortable at voice and screen share, but I'm still not a fan of turning on the video.

I'd say that given I don't do much OP coding, maybe it would be more of a point-and-talk to me about where the repo is and all that. Or, if you're interested, we could freestyle some Blender basics, since you were asking about it the other day.

Cheers
Title: Re: Remote Pair Programming
Post by: leeor_net on May 24, 2017, 03:23:51 PM
I don't know anything about the Discord chat, but google hangouts does not require additional software and adverts (at least not in my experience). You just log into google (I use chrome), start a hangout, then pass the link to someone and they can join. I'm not pushing for Hangouts, just saying that it's also web browser capable and pretty much only requires a google account.

True, but Hangouts has an annoying habit of being flaky when you actually need it to work. I've found discord to be much more reliable in these situations.

Also, I'm quite introverted like Leeor. So I feel your pain there. It can take a little getting used to.

I'm doing my best to try to get over myself. I still find it odd that voice chat over the 'net is so threatening to me. I know I have a tendency to stumble over my own words so it probably comes down to thinking I sound like a bumbling idiot.
Title: Re: Remote Pair Programming
Post by: Vagabond on May 25, 2017, 01:35:29 AM
Just watched a video on pair programming. Some good info on remote pair programming as well. I think worth the watch if you have 30 minutes. Obvious bias towards pair programming, but we are all here discussing it, so maybe that is appropriate.


The speaker doesn't really see sharing screens and passing the code back and forth as actual pair programming. Passing it back and forth through a repo and not sharing the IDE means a lot of down time and there is a lot of delay to switch who is typing (driving). I think ideally you should be both able to type at the same time. Not that you should type at the same time, just that there isn't any barrier to switching pairs. It is like source code that takes 3 minutes to compile. I start compiling it as least often as possible to avoid the down time. I think the same would happen if you had to commit/push and the pull the code and then switch whose screen is being shared.

I don't have any issues with video sharing on top of the voice sharing. I think video sharing each other's faces is probably the first thing to go if bandwith is an issue. Without audio sharing you would be forced to type everything into chat though which would really defeat the purpose of pair programming anyways.

We could probably save a lot of bandwidth by somehow just sharing the screen contents instead of the pixels. I mean when I type a letter, it sends to the other person's CPU that the letter was typed instead of sending a capture of my screen. This would probably help with the latency too. https://www.quora.com/What-are-the-best-tools-for-remote-pair-programming

I'm sort of swimming in the options right now though. Maybe tomorrow I'll take another look through them. I'm guessing we are looking for a free option. I don't mind paying a nominal fee if a good option requires it.
Title: Re: Remote Pair Programming
Post by: Hooman on May 25, 2017, 05:01:52 PM
Quote
I've been wanting to do this with you since you PM'd me about it a couple of years ago... but I'm also an extreme introvert and am very nervous about using voice chat software. Not because of privacy reasons (don't care about that, i have nothing to hide) but because I'm very awkward and voice chat creates a much more personal connection vs. text chat.

I know exactly what you mean. I've put off pairing for years due to similar concerns. I'm actually not comfortable with video at this point. That does feel pretty personal. That's one reason why I prefer audio.

I figure audio is a bare minimum. It would be very awkward to share a session with someone you had no verbal communication with. You don't want to type to each other in the code window, and having to tab about to type in a communication window would be weird and slow. Too much context switching, and it takes you out of the code.

I had actually thought of using Discord for this. I want to start with more common tools as a baseline first. Basically I want to convince myself how common tools probably suck, and the lesser known tools provide a much better experience. I figure these other tools exist for a reason, and I want firsthand experience to justify using them.

@Vagabond: We can have multiple sessions. I actually expect multiple sessions. I don't expect more than 2 people at a time. Though that might be interesting to try. Scheduling could be difficult with more people though, and some software might limit to 2 people.

Quote
Not sure how to use it gainfully though... If I have some time, I'll try to find a tutorial on using HxD or something in the next couple of days.
Don't worry about it. I mostly just use it to quickly look at binary data. I don't generally do anything fancy with it. Besides, hex editors tend to be fairly simple tools with not a whole lot of features, so you can just sort of learn it on the spot.


As for Remote Desktop, I may be a bit confused. As I just read, and now vaguely remember, using Remote Desktop will actually log out the local user before logging in the remote user. Not very useful. Instead, use Remote Assistance, which lets both users be logged in at the same time. I also vaguely remember you can enable or disable control for the remote user. I was planning to use Remmina (https://www.remmina.org/wp/) to connect. Not sure if it supports connecting to an existing desktop session such as with Remote Assistance. From what I understand, it's the same underlying protocol.

My idea was to use voice chat, screen sharing, and shared control. The last one could potentially be worked around if voice instructions are clear, though that gets a bit away from the idea of pair programming.

This also simplifies software use somewhat, since it only needs to be installed on one computer.

There are alternatives to screen sharing. I've heard the Cloud9 IDE can link with someone else so updates are visible to both. It's a shared editing environment, but isn't a full desktop environment. It can be a bit faster since it's just keypresses and actions being exchanged between two copies of the software running on both machines, with no need to send images. Not having the shared desktop means you can't share external tools, so it's not quite a full replacement.

We can discuss the specifics of the project during the session, and perhaps just let it evolve as we go. I figure C++ would be a good choice, though I'm open about language. I've dabbled with this idea in D, and also thought about using JavaScript. You can use NodeJS to run JavaScript outside the context of a web browser. NodeJS provides API libraries to access the file system and other such resources, much like any other programming language.

@White Claw: Google Hangouts is one of the options I wanted to try. I've also noticed Google released a Google Chrome plugin for screen sharing. Might be related, I'm not sure.

Quote
I think the best time for me would be somewhere around 6-8am GMT (if I'm doing the math right).
That works out to 2pm-4pm for me. Quite convenient. Weekends are no problem.

I would prefer solutions that don't put the host at risk of funny business. If there is shared keyboard and mouse editing capabilities on a desktop, the possibility would exist for them to go opening strange programs and typing in strange commands, though I would also assume in a shared screen environment the local host would notice this and kill the connection. And also never pair with that person again.

Quote
I'd say that given I don't do much OP coding, maybe it would be more of a point-and-talk to me about where the repo is and all that. Or, if you're interested, we could freestyle some Blender basics, since you were asking about it the other day.
Those are both good ideas.

@leeor_net:
Quote
I'm doing my best to try to get over myself. I still find it odd that voice chat over the 'net is so threatening to me. I know I have a tendency to stumble over my own words so it probably comes down to thinking I sound like a bumbling idiot.
All the more reason to practice with people who won't mind.

@Vagabond: I think I've actually watched the video before. Indeed, there are a lot of resources out there.
Title: Re: Remote Pair Programming
Post by: White Claw on May 25, 2017, 10:05:07 PM
@Vagabond: Thanks for the video. I will have to check that out (possibly tonight).

@Hooman: I'd be willing to try to give it a go this weekend, but I'm still not certain what my schedule will be on Saturday or Sunday night. This is our last weekend before we move, so we plan on going out and about during the weekend. I suspect I'll be home in the evening, but it's possible we might still be out in town. I'll try to be more "firm" tomorrow. We can meet up in IRC before hand too?

Since it's a "lets try this and see," then perhaps we can do a little bit of both OP code stuff (tutorial for me) and Blender (tutorial for you). Though that might be a lot to try and cram into an hour.
- I'm open to suggestions on where to start on the OP side, and if there's any particular software or whatever that I should install first, let me know and I'll try to get it done before hand. I already have MSVS 2015. I do more C#
- If you want to try Blender, go ahead and install it (if you'd like) and we can figure out what we want to do. If you have a specific goal in mind, let me know. Otherwise I can just run through the introductory basics.

@Leeor: I'm happy either way. I don't get paid by google or anything, it's just what I've used in the past. I've had descent luck with screen share on it, but I've also experienced some issues. Also, we all sound like bumbling idiots, so no problem!   ;D
Title: Re: Remote Pair Programming
Post by: Vagabond on May 26, 2017, 02:30:42 AM
I just installed Chrome Remote Desktop. It seemed to be well regarded for pair programming and is free. Unfortunately, I cannot even share my Windows 10 PC with my wife's Windows 10 PC. It will recognize the 2 computers are talking and ask for final verification. When clicking yes, it immediately goes to a text box saying the entered authentication code is invalid. Quick internet search revealed it is a problem for others but no solution. Tried turning off firewalls and running in admin mode on both CPUs to no avail. We are not using any heavy antivirus software either, so not sure where to go with it.

Unless someone has another idea for troubleshooting, I think Chrome Remote Desktop may be out for me. If my wife's machine is the problem, maybe just trying a different machine would work...

https://chrome.google.com/webstore/detail/chrome-remote-desktop/gbchcmhmhahfdphkhkmpfmihenigjmpp?hl=en (Not sure why there needs to be 380 characters on the end of the link? I feel like google should be using cleaner links than this.)

----

I was able to get TeamViewer to connect my wife and my computers together. It has built in chat, audio, and video. The software costs money for commercial use but is free for non-commercial use. A single window popped up at the end of the session saying you are using the free version, do you want to purchase the paid version with something about thanking you for your honesty. All seemed to be fairly tasteful and otherwise without advertisements. Not sure if anyone has any good / bad using TeamViewer before?

It is available for Linux, MAC, and Windows.

https://www.teamviewer.com/en/

----

I looked a little at the built  in RDP (remote desktop protocol) on Windows 10. It is called Remote Desktop Connection App. Played with it a little and was fairly confused. I think if Remmina is set to use RDP protocol, it would in theory be able to talk with it. I would have to sit down and play with it some more before being comfortable going this route. It might be nice because it wouldn't require installing something as heavy as TeamViewer, but definitely more confusing to understand (for me anyways).

----

I already use Discord on occasion. I would be happy using it for voice and chat unless we went with TeamViewer that has both functions built in already. I would prefer it to Skype. I've never tried Google Hangouts, but would be certainly willing to try it out.

----

Seems like video is out for the pairings.
Title: Re: Remote Pair Programming
Post by: Hooman on May 26, 2017, 04:24:25 PM
I can try to be around IRC on the weekend.

Mixing OP and Blender stuff would be cool.

Suggested software/setup (depends on what will be done, I'm including some extras):
TortoiseSVN  (most things)
Checkout the OPU repository  (most things)
Microsoft Visual Studio, with C++ compiler installed  (levels, extensions, some utilities)
HxD  (binary file viewing and editing)
OllyDbg  (disassembly/reverse engineering, patching)
Notepad++  (text editor for any coding outside visual studio, possibly web development)
PuTTY  (web server maintenance)

We don't have plans to use the last few, but if someone is interested, those topics can be touched on as well.

I've also installed Chrome Remote Desktop, Team Viewer, Discord, and Skype.

My initial reading on Remmina and Remote Desktop/Remote Assistance sounds like that might not work as I'd hoped.
Title: Re: Remote Pair Programming
Post by: leeor_net on May 27, 2017, 02:02:24 AM
I would just use TeamViewer for screen sharing. It's free for non-commercial use, it has a built in voice and text chat feature and it's about as effective as you can get for this sort of thing. As for bandwidth, that one is difficult -- it has an optimization for speed over quality which gives you a fairly rough image with a lot of jpeg artifacting but it works and only sends the portions of the screen that change though over really slow connections there is some latency. Nothing that can't be overcome though.
Title: Re: Remote Pair Programming
Post by: Vagabond on May 27, 2017, 08:03:24 PM
Leeor, thank you for the suggestion on TeamViewer!



Hooman,

All the software choices sound good. I have everything mentioned installed except for PuTTY.

I'm willing to host as discussed earlier. I'll clean my laptop's desktop off today so we can work there without it being super cluttered.

If you are available, we can move up the start time to 2300 GMT on Sunday (2 hours earlier than previously agreed). It would fit a little better for me, but not a problem if you want to stick to the original time.

I'll try to message you on Discord or the Outpost IRC room if you are not on Discord around the start time.

I'll start pushing resolution 1366x778 initially unless you need something else. If lag/video quality is a problem we could try dropping my screen resolution a little and seeing what that does.
Title: Re: Remote Pair Programming
Post by: Hooman on May 28, 2017, 06:27:19 AM
Ahh yes, screen resolution. I should mention my cheap, small, portable travel laptop only has a max resolution of 1366x768. Anything more means scrolling or scaling.

I can do 2300 GMT Sunday. That might actually work better this week.
Title: Re: Remote Pair Programming
Post by: White Claw on May 28, 2017, 12:38:44 PM
@Hooman: I was on last night for about 1.5 hours, then I realized that I probably screwed up. I said Saturday, which for me it was...but it was actually Sunday GMT. Hopefully I didn't leave you hanging. Sorry dude... :-\
Title: Re: Remote Pair Programming
Post by: Hooman on May 28, 2017, 12:53:04 PM
We never really set a specific day or time. I wasn't sure when to expect you. Thinking back, I may have uncharacteristically been sleeping at the time you were likely on.
Title: Re: Remote Pair Programming
Post by: leeor_net on May 28, 2017, 01:58:36 PM
Hooman sleeping? That is uncharacteristic...  :o
Title: Re: Remote Pair Programming
Post by: Hooman on May 28, 2017, 05:12:12 PM
My thoughts on sleep (https://www.youtube.com/watch?v=3VtSWb4-7UA)  :P


On a more serious note though, sorry to have been sleeping at that time. I seem to have had the times mixed up. For some reason I was thinking I needed to be around either early morning or late evening. Also compounded by my poor sleep habits as of late.
Title: Re: Remote Pair Programming
Post by: White Claw on May 29, 2017, 01:30:11 AM
Yeah, no worries. Looking back at my message, I also see that I wasn't clear at all (it's been a busy couple of days). Maybe we can try to set up another time in the future, though it may be a bit before my schedule is settled. My internet gets turned off in about 36 hours, then I'll only be on mobile to check the forums.

Cheers
Title: Re: Remote Pair Programming
Post by: Vagabond on May 29, 2017, 02:31:42 AM
The first pair programming session was a pretty big success. It took us about an hour and a half to slog through the technical details of software setup. and then we probably spent about 2.5 hours split between pair programming and reviewing Outpost 2 internal data.

I had a great time and learned a lot in the process.



Environment Setup Details

Chrome Remote Desktop would not secure a connection between our computers (I think it was on my end, but not sure).

Next we tried TeamViewer. The initial link setup was easy. Screen quality was good and lag was only bothersome when scrolling through a lot of text. (Hooman can speak to the latency better than me since I was the host.) It took us a long time to get audio setup. Hooman could hear me but I couldn't hear him. We eventually tried audio through Discord with TeamViewer. There was an extremely annoying echo in Discord when TeamViewer was on. Turning off TeamViewer and Discord would transmit the audio fine. We eventually got TeamViewer's internal audio function via VoIP to work.

After about 1.5 hours of fiddling, we got it all up and running at 1366x778 resolution without much lag. We live geographically distant from each other, so I was pretty happy with the screen sharing and audio quality. My kids only burst into loud crying once during the session, so it wasn't too embarrassing. :)



Pair Programming Results

We reviewed the info on the repository on how Map files work. (By review, I mean Hooman taught me and then showed me how to use a hex editor, very nice of him). Then we started a C++ console project. The repo contains all the backend code for the map editor. Within this code is a a C++ file for representing and parsing a map file. It is designed as COM compatible and didn't include a couple of the details that have been discovered about the MAP file format since it was created.

We elected to create a new struct to represent the map data. The newer version is be a little easier to read without the COM decoration and uses some more modern C++ features like std::vector. It was also key for me to work through to learn what was going on since I'm not a great C++ programmer. We ended the pair programming session having read most all the data from the MAP file into the MapData struct in C++.

I'm going to spend a little time cleaning up the code and then will post it to the Outpost 2 repository. Need to figure out where we want it in the repo though.



Project Goals

I think where we are going with this is creating a console application that can render images of Outpost 2 maps in different sizes. IE you could render a map at 50% of its normal size. The current map editor only produces the small thumbnails and only in BMP format. I am happy the map editor has the functionality it does, but I would like to see more.

The next step should probably be either gaining access to VOL file contents or mapping tileIDs from the map to their respective tiles on the sprite sheets. There is a file in the OllyDbg section of the repo with a lot of info on the VOL format.

Tentative Project Goals:

* Able to render a map at a custom size in common image formats. Probably at a minimum BMP and PNG or JPEG.
* Able to handle batch rendering of multiple maps if desired.
* Able to read required content out of VOL files to include WELLs, Tile Sets, and Map files.
* Separate the console application from the backend code so if someone ever wanted to create a new Map Editor, they could plug in the imagery code to allow quick rendering of maps in custom sizes and common image formats.
* Try to create a useful library for how to manipulate VOL files and MAP files. I think this may already exist in the old Map Editors code though.

I should probably let Hooman comment if he has any different goals though since it is half his work. And enough rambling for now.
Title: Re: Remote Pair Programming
Post by: Hooman on May 29, 2017, 09:15:49 AM
Yes, TeamViewer worked pretty good. Lag was minimal, mostly only noticeable when I was trying to scroll to a specific point in a file, and even then not all that much.

TeamViewer can be used with or without registering an account with TeamViewer. It's easiest if you register an account with TeamViewer using your email address, and then add the other person to your friend's list. That allows you to easily send a request to join them using their computer, which they can accept or deny. There is another method we tried first, which didn't require registering an account with TeamViewer, and involved sharing access codes, similar to a username and password. Beware though that these access codes let someone join without prompting to accept on the host end. This method seems to be useful for accessing your own computer remotely, so you can join while it's unattended. To aid this feature, TeamViewer is also set to launch at startup by default when you install it. If you're security conscious, you might want to change that option, and perhaps not use the access code sharing method.

There was some trouble initially getting TeamViewer to use the mic on my end. It was only transmitting audio one way at first. We tried using Discord for the audio, but since TeamViewer was still transmitting audio one direction, including what Discord was playing, it caused my voice to echo back 1 or 2 words later. Very hard to speak clearly when you hear a delayed echo of yourself. It messes with your brain, confuses you, and makes you slur your words trying to compensate. Try it sometime, it's weird and fascinating. I eventually got the mic to work, though in hindsight I wonder if it may have had something to do with closing Skype first.

Chrome Remote Desktop did not connect for us. It failed during the connection attempt, after alerting the other side.

----

Stated project goals seem quite good. I've wanted something that can make scaled images of maps for a long time.

More generally, I would like new code to allow for easy cross platform extraction of game resources. Many of the current tools are Windows specific, and have extra dependencies that need to be installed. I'd like standalone utilities available with minimal dependencies, to ensure stuff just works wherever. Ultimately, I want to make it easy for anyone to access game resources, either through library code, or without needing to program anything, in easy to use standard formats. That should allow people to do whatever they want with the resources, creating new utilities, editing resources, or extracting resources for use in new projects or remakes. I'm hoping easy access to the game resources might spur on new projects.
Title: Re: Remote Pair Programming
Post by: Vagabond on May 29, 2017, 09:22:17 PM
Just finished pushing OP2MapImager code into the repository at: \Outpost2SVN\GameResources\OP2MapImager.

I separated the code into 2 more files: MapFileReader.h and MapData.h. I pushed all the code to parse the map file into a class called MapFileReader. All methods except void ReadMapData(MapData& mapData, string filename) are encapsulated as private. I added documentation to most members of MapData.h since it is a very important public structure. Those comments should be proofed by someone else. I'm still not an expert at the contents of the map file.

I also added helper functions to return the map width in non base 2 log form and the tile set filename as a std::string (the parsed data does not include a '\0' terminator). This way an end user doesn't have to deal with odd implementation details, but the data in the MapData struct still represents the MapFile content.



If anyone wants to continue on the project, I am available on Sunday, 4 June at Midnight GMT - 5 June 3AM GMT. That is Sunday 7-10PM Eastern US Time. If this is too early, we could also push later in the day. Looking at about a 3 hour chunk of time for the pairing.

I'll probably discontinue working on the project until then with the possible exception of researching a library for image manipulation or minor fixes if anyone notices dumb things in the code in the repo over the work week.

I'm happy to work with Hooman again or if someone else wants to jump in, myself or Hooman could rotate out? Or if there are 4 of us, we could pair on 2 different projects.
Title: Re: Remote Pair Programming
Post by: Hooman on May 31, 2017, 05:54:39 AM
Your convenience methods sound like a good idea.

I'd be happy to pair with you again. I've noted it in my calendar.
Title: Re: Remote Pair Programming
Post by: Vagabond on June 01, 2017, 03:41:06 AM
It looks like a console VOL decompress/compressor already exists in the repository (Outpost2SVN\GameResources\VolDecompress). The code looks clean and easy to read. While reviewing it, I realized void main(int argc, char **argv) contains a pointer to a pointer (**)... I had to look that up.

Anyways, the program is incomplete:

Code: [Select]
void OutputUsageMessage()
{
// Print usage info
cout << endl;
cout << "OP2Decomp - The Outpost 2 decompressor/unpacker for VOL and CLM files" << endl;
cout << endl;
cout << "To extract all files from an archive:" << endl;
cout << "OP2Decomp [filename]" << endl;
cout << endl;
cout << "To pack a list of files into an archive:" << endl;
cout << "... not sure on syntax yet (but code exists!)" << endl;
}
It looks like at some point we should probably finish up the console interface of the application and separate the backend logic into a library project. Then the OP2MapImager could just reuse this VOL library instead of re-doing all the VOL decompress code. It looks like a lot of work went into writing the code, including a Huffman Tree for compression. I also had to lookup what a Huffman Tree is.




More generally, I would like new code to allow for easy cross platform extraction of game resources. Many of the current tools are Windows specific, and have extra dependencies that need to be installed. I'd like standalone utilities available with minimal dependencies, to ensure stuff just works wherever. Ultimately, I want to make it easy for anyone to access game resources, either through library code, or without needing to program anything, in easy to use standard formats. That should allow people to do whatever they want with the resources, creating new utilities, editing resources, or extracting resources for use in new projects or remakes. I'm hoping easy access to the game resources might spur on new projects.


Since we are currently working in Visual Studio, I think the code can only be easily compiled for use in Windows. I'm guessing it should be pretty easy to use through Wine on Linux though?

If we keep the applications simple enough and generic, the files could be loaded into a new solution in an IDE that supports a Linux or Macintosh compiler and then compiled for use. Is that sufficient?

I don't know a lot about other compilers, but if we used something else like Vim or EMACs, would that be trivial to switch targets and compile natively for Windows, Linux, or Macintosh. Besides a couple of Code::Blocks projects, I believe everything in the repo right now is Visual Studio.

I'm not well versed on cross platform development.
Title: Re: Remote Pair Programming
Post by: Hooman on June 02, 2017, 02:15:16 AM
Code: [Select]
void main(int argc, char **argv)
The argc is the number (count) of command line arguments. The argv is the actual command line arguments. It is an array of strings, where each string is an array of chars. As each array decays to a pointer, it's simply written as a double pointer.

It might not be a bad idea to finish that project. I'd forgotten about that note about not having a command line interface to repack VOL files.

It's possible the compiled code might run on Linux under Wine. However, the code can't currently be compiled under Linux, which creates a significant barrier to development for anyone using Linux. You could run a compiler in a VM, but this is still an extra step that doesn't integrate well with tooling.

The problem doesn't come from using Visual Studio. That's just an IDE, which is really just a glorified text editor. The problem comes from the code using platform specific features through direct API calls.

The files with platform specific code are CArchiveFile, CVolFile, and CClmFile. Within them, you'll notice "#include <windows.h>". They also make use of the Windows specific HANDLE type, for referencing file handles, along with associated functions: CreateFileA, MoveFileA, DeleteFileA, CreateFileMapping, MapViewOfFile, and WriteFile. To make the code platform independent, those files would need to be rewritten to replace those occurrences.

The files CAdaptHuffTree, CHuffLZ, CBitStream, and even Main.cpp don't appear to use platform specific features themselves, they just rely on the other files that do.

Then there's getting it all to compile in one easy command on a new platform. You'd need a replacement for the Visual Studio project file that basically says what your sources files are, and how to feed them through a compiler. Typically this is done with a Makefile. This is a small issue. Visual Studio already has a built in tool to output a suitable Makefile.
Title: Re: Remote Pair Programming
Post by: Vagabond on June 04, 2017, 12:58:16 PM
@Hooman, I'm still on for the pair programming in about 6 hours (4 June at Midnight GMT - 5 June 3AM GMT). I'll be on Discord and in the OP2 Quake chat room.



I did a little research on cross platform development. This article is about 7-8 years old but I liked some of the advice in it: https://www.backblaze.com/blog/10-rules-for-how-to-write-cross-platform-code/. I also spent a little time reading an overview of makefiles.

The author recommends writing your own functions for file access and other platform specific code and isolate it to a specific areas in your code. You can then control the content of the file access functions using pre-proccessor directives like #ifdef _WIN32. So you could use the native operating system code for each supported operating system in the function. This would isolate all your platform specific code to one or a couple of files and allow you to build with the same .h/.cpp files on any supported platform.

I think a similar option would be to create an interface for the platform specific code functions and then write classes to fulfill the interfaces for each supported platform. You could then use a pre-processor directive to actually load the proper class fulfilling the interface. I have never attempted interfaces in C++, but my understanding is there is no built in support, so you have to sort of hack it.
Title: Re: Remote Pair Programming
Post by: Vagabond on June 10, 2017, 12:58:57 AM
Next session will be this Sunday, 11 June at Midnight GMT - 5 June 3AM GMT (same time as last weekend). That is Sunday 7-10PM Eastern US Time. Looking at about a 3 hour chunk of time. Sorry for the late post.

Looks like the plan will be getting the Outpost 2 specific BMP files loaded into memory, then passing the BMP off to FreeImage for crunching. If time remains, we can work on getting FreeImage to actually scale down an image and paste it into a larger imager.
Title: Re: Remote Pair Programming
Post by: Hooman on June 10, 2017, 10:07:52 AM
Sounds good. Might take a bit of time to handle the custom image format. I should probably review the existing code since it's been a few years.
Title: Re: Remote Pair Programming
Post by: Hooman on June 25, 2017, 01:54:13 PM
@Vagabond: I'm back from my short banishment from the internet. I'll have to look through your updates to see how things sit, though it looks like you've basically got it working.

@leeor_net: I want to know how outposthd development is going, and what your process is like. Now that some patches have been submitted for the code to compile on Linux, there is little excuse not to look more into your project.


On another note, I've been wanting to experiment with Ruby/Rails and websockets. Anyone interested in some exploratory work? I'm thinking of a test project such as a simple chat room, just to see how the technology fits together.
Title: Re: Remote Pair Programming
Post by: leeor_net on June 26, 2017, 01:38:51 PM
I've been focused on another project at the moment, one that brings in a small amount of income but nonetheless is income.

Would def like to continue work on OPHD at some point though.
Title: Re: Remote Pair Programming
Post by: Vagabond on June 27, 2017, 03:39:11 AM
Hooman,

Yes, the OP2MapImager is functioning! Right now I am currently looking through your VOL Decompress code. It looks like I can adopt it without too much trouble to allow the OP2MapImager to search VOL archives in a directory for the given map and wells. I can structure the program to look first in the directory itself and then through the vol files until a map or well with the given name is found. This way a loose file in the directory takes precedent over a file archived in a VOL.

I'll want to modify your VOL decompress code a little to allow sending a list of all filenames within the VOL among other things. How sensitive are you to me mucking around in the VOL decompress code? I would like to make a branch preserving what you have stable. (I've never done this in SVN, so hopefully fairly straightforward).

The other piece is loading the non-standard Outpost 2 TileSet BMPs into memory. I've designed a function within the MapImager class that accepts the raw bits instead of loading a file from the hard drive. I could use some help getting the BMPs into memory. Without help here, I will probably just distribute the modified BMP files with the application instead of hacking my way through the process.

Feel free to work on the MapImager as you see fit. I'm being good about uploading my progress regularly to SVN and checking for updates to keep from getting out of sync with any possible work you do.

Depending on where we want to draw the line on adding new features, the OP2MapImager should be ready for initial release within 2-3 weeks (hopefully????). There is still a lot of cleanup that should be done to the code.

I printed off some talking points about what D is supposed to be and an interview article with one of the 2 creators to read through. It is currently on the TIOBE index as number 22, 1.416% (https://www.tiobe.com/tiobe-index/). Just starting to warm up to trying something in the language and you are already off to Ruby on Rails!

Anyways, I will probably not be available again for pair programming until around middle of August. Once we are in August or my schedule changes earlier then expected, I will see where everyone stands and what the interests are.
Title: Re: Remote Pair Programming
Post by: Hooman on June 29, 2017, 10:42:47 AM
Your precedence rules are correct, in that the game looks for loose files before checking the contents of the VOL files.

Quote
I'll want to modify your VOL decompress code a little to allow sending a list of all filenames within the VOL among other things.
Why?

My gut feeling is there's probably a better design to whatever it is you're trying to accomplish, though I'm not clear on what it is you're trying to accomplish.

Quote
The other piece is loading the non-standard Outpost 2 TileSet BMPs into memory. I've designed a function within the MapImager class that accepts the raw bits instead of loading a file from the hard drive. I could use some help getting the BMPs into memory. Without help here, I will probably just distribute the modified BMP files with the application instead of hacking my way through the process.
Very practical set of choices here. Not just in code design, but also in project management, and how the code will evolve.


We can cover some D in a future session if you'd like. Ruby as well. Maybe throw in some JavaScript at some point too. I have multiple project ideas. But, all in good time. Let's try to finish what we've started first before getting too carried away.
Title: Re: Remote Pair Programming
Post by: Hooman on August 30, 2017, 12:05:27 AM
It's been a while. I thought I'd make an updated list of project ideas for pair programming sessions.

Vagabond's projects:

Vagabond has done an impressive job with these two. They are now largely complete and usable.

A few features can still be finished, such as adding support for the native OP2 tileset in the map imager, and getting the archive code to compile on Linux. It might also be worth exploring the use of Git and GitHub for these projects. There's been some talk of moving coding projects out of our self hosted SVN server, and onto GitHub. This could be a good place to start with that.


Future project ideas:

And remember, any group of people that wants to give pair programming a try is welcome to give it a go. You don't need permission.
Title: Re: Remote Pair Programming
Post by: Arklon on August 30, 2017, 04:36:34 PM
WebChat: A WebSocks based chat client and server, similar to IRC. This would use JavaScript on the frontend, and possibly use Ruby on Rails for the backend. I view this more as an exploratory project to experiment with and learn some Rails and WebSocks programming. One selfish reason being these skills could look good on a resume. Another reason is simply to increase the web development skills in this community. Though not specifically an objective, people have in the past toyed with ideas such as integrating chat with launching games, or alternate game servers. If someone wants to go down that route, they could use this project as a base.
I think a nicer way to go would be making a JS frontend for IRC, which is how Twitch chat works. IRC has stood the test of time, building around that would let people connect to chat using whatever IRC client they want and not be limited to just whatever frontend(s) we provide, more readily enable the use of bots, allow BNCs, etc.

Some Twitch streamers embed chat on their website, which I believe someone had to implement their own JS IRC front end to accomplish that, so presumably there's source code for that around somewhere. If you can find it that'd make a good reference point.

I'd be more interested in the pathfinding stuff as you know, but you also know I'm mostly just interested in procrastination.
Title: Re: Remote Pair Programming
Post by: Vagabond on August 30, 2017, 09:35:02 PM
Actually, I'm available this Sunday 3 Sep at Midnight GMT - 4 Sep 3AM GMT (same time Hooman and I used last time). I can shift this time a few hours later if helpful for someone else.

My first choice would be removing windows.h from the Archive code. If we get far enough, then working on a Linux build either through a makefile or a fresh Linux project. I currently do not have access to a Linux OS so if the pair had Linux it would be helpful! However it might take the full time to get windows.h out of the CLM code, so no big deal if we just work Windows for the session. I would tend to test code changes using the OP2Archive program since it has a working EXTRACT and CREATE command.

Other things I would be interested in is hooking Google Test into OP2Archive for unit testing. I'm not looking to commit to a major project right now (especially since OP2Archive isn't complete) though I suppose I could help for the session if someone has a burning desire to start something bigger.

Sorry for the short notice.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on August 31, 2017, 08:51:17 AM
Quote
I think a nicer way to go would be making a JS frontend for IRC, which is how Twitch chat works. IRC has stood the test of time, building around that would let people connect to chat using whatever IRC client they want and not be limited to just whatever frontend(s) we provide, more readily enable the use of bots, allow BNCs, etc.

To be clear, I'm not proposing we replace IRC. You're right in that IRC has withstood the test of time.

I'm suggesting this more as a potentially fun simple small project to start increasing the amount of web development skills around here. If someone wants to take the code and run off to build some crazy hair brained scheme, they're more than welcome, though I have no plans on using this project to replace IRC. It's also why I don't want to use pre-built code.

As for having a JavaScript frontend that interfaces with IRC, I don't believe that's possible without going through a custom server. One of the aspects of WebSockets, is you have no control over the wire representation of your data. This is for security reasons. The browser will send each packet XORed with a random mask (included in the header of the packet), which the server must undo before processing the data. This value changes with each packet, using a secure random number generator, to ensure the server doesn't communicate the mask back to the client and have the client trivially undo the masking. This is specifically to prevent browser traffic from impersonating traffic for other protocols. Remember browsers are running untrusted code from over the internet, so the implications of being able to write an IRC client in the browser would be great.

Basically what I'm saying is, any IRC like JavaScript frontend, will need to communicate with a custom server, perhaps written using Rails (or Node, or whatever). Whether the server then interfaces with IRC is a separate question.

Quote
I'd be more interested in the pathfinding stuff as you know, but you also know I'm mostly just interested in procrastination.
I included that one for a reason.  ;)  Now would you like to schedule a time to procrastinate, or perhaps procrastinate about procrastinating?


Quote
Actually, I'm available this Sunday 3 Sep at Midnight GMT - 4 Sep 3AM GMT
That's 4 Sep 9am - noon my time, so that would work for me. I made a note on my calendar to be on IRC at that time.

Quote
My first choice would be removing windows.h from the Archive code. If we get far enough, then working on a Linux build either through a makefile or a fresh Linux project. I currently do not have access to a Linux OS so if the pair had Linux it would be helpful! However it might take the full time to get windows.h out of the CLM code, so no big deal if we just work Windows for the session. I would tend to test code changes using the OP2Archive program since it has a working EXTRACT and CREATE command.

Agreed, removing windows.h from the Archive code is a priority. I was taking a look at my old VolDecompress project last night, testing some changes in a Windows VM. I figured I'd start there since, well, it was my old project and I'm most familiar with it. Plus I wouldn't be stepping on your toes if you were doing active development on your project. I should probably switch over to your project though. At the very least, changes should be directly applicable to what you're doing. Perhaps following a set of small changes, using Git, could be a good way to become familiar with that version control system.

I think once we have the windows.h stuff removed, then we can switch to developing on Linux. I can host for that. That might be a future session though.

The Google Test stuff could be interesting. For now I'm considering that a problem for a future session.
Title: Re: Remote Pair Programming
Post by: Vagabond on September 01, 2017, 03:52:42 AM
Quote
Agreed, removing windows.h from the Archive code is a priority. I was taking a look at my old VolDecompress project last night, testing some changes in a Windows VM. I figured I'd start there since, well, it was my old project and I'm most familiar with it. Plus I wouldn't be stepping on your toes if you were doing active development on your project. I should probably switch over to your project though. At the very least, changes should be directly applicable to what you're doing. Perhaps following a set of small changes, using Git, could be a good way to become familiar with that version control system.

I think once we have the windows.h stuff removed, then we can switch to developing on Linux. I can host for that. That might be a future session though.

Sounds good. I haven't made drastic modifications to the decompress code so any ideas you have will be easy to transfer over. I'll be on IRC as well. I'll plan to update to the newest version of Team Viewer, Discord, and my IRC client Friday or Saturday so they won't be pestering me to update during the pair programming.

-Brett
Title: Re: Remote Pair Programming
Post by: Arklon on September 02, 2017, 11:36:24 AM
To be clear, I'm not proposing we replace IRC. You're right in that IRC has withstood the test of time.

I'm suggesting this more as a potentially fun simple small project to start increasing the amount of web development skills around here. If someone wants to take the code and run off to build some crazy hair brained scheme, they're more than welcome, though I have no plans on using this project to replace IRC. It's also why I don't want to use pre-built code.

As for having a JavaScript frontend that interfaces with IRC, I don't believe that's possible without going through a custom server. One of the aspects of WebSockets, is you have no control over the wire representation of your data. This is for security reasons. The browser will send each packet XORed with a random mask (included in the header of the packet), which the server must undo before processing the data. This value changes with each packet, using a secure random number generator, to ensure the server doesn't communicate the mask back to the client and have the client trivially undo the masking. This is specifically to prevent browser traffic from impersonating traffic for other protocols. Remember browsers are running untrusted code from over the internet, so the implications of being able to write an IRC client in the browser would be great.

Basically what I'm saying is, any IRC like JavaScript frontend, will need to communicate with a custom server, perhaps written using Rails (or Node, or whatever). Whether the server then interfaces with IRC is a separate question.
True. Twitch's IRC server is custom, and so are their services. Luckily there's lots of good open source IRCd's that could just be modified to be websocket-friendly. We used InspIRCd back when we ran our own server, which is pretty good as I recall and it's open source. Not sure what good services packages there are out there; we used Anope and Epona with our server I think but those were questionable. For something like forum integration we'd have to roll our own NickServ though.
Title: Re: Remote Pair Programming
Post by: Hooman on September 06, 2017, 12:30:18 AM
Forum integration, now there's an idea!  :)


As for the pair programming sessions, we had a 3-way last time, so no need to limit to just 2 people per session. It seems TeamViewer is quite capable of connecting more people at the same time.
Title: Re: Remote Pair Programming
Post by: leeor_net on September 06, 2017, 02:27:52 PM
That's because TeamViewer is awesome and I love them for allowing free use for personal use. I wish I could afford to pay them to support their development.
Title: Re: Remote Pair Programming
Post by: Vagabond on October 02, 2017, 08:08:06 PM
We had another successful pair programming yesterday between myself and Hooman. It was more exploratory than earlier sessions in which we had a specific goal in mind.

We hooked OP2Utility to both OP2Archive and OP2MapImager via submodules in Git. We then spent some time playing around with commits and pushes in the submodule to see how it propagated between the applications depending on the submodule (OP2Utility).

VS2017 has built in integration with Git. This is nice, because you can see at a glance which files in your solution explorer have uncommitted changes in them. We were able to push Git repo changes directly from VS2017. We spent some time exploring Git in VS2017. I think I still prefer the interface of using TortoiseGit more than doing it from VS2017, but we didn't spend enough time there to make that call for sure.

The last piece left undone was figuring out how to update the version of the submodule a repository uses when submodule changes are pushed.

If others are interested in pair programming in any form, I would encourage them to post here with times and projects. Don't feel like you need a specific amount of expertise to participate.

And I'll echo Leeor that TeamViewer has been a great application for the pairings.

-Brett
Title: Re: Remote Pair Programming
Post by: leeor_net on October 02, 2017, 10:49:45 PM
As a note, VS2015 also has Git built in.

Anyway, would love a rundown of the submodules thingy you guys were working with. It's something I've been meaning to look at but never seem to have the time.
Title: Re: Remote Pair Programming
Post by: Vagabond on November 07, 2017, 01:57:44 AM
I wanted to schedule another pair programming session for this coming weekend to work on OP2Ext.

If someone wants to move OP2Ext over to Github beforehand, that would be nice or we can start the session out with that. After moving it over, I'd like to tag the current code state and place the current DLL in the release section of GitHub created by the tag. I guess we could call it version 1.0.0 unless someone has a better idea. After that, We will want to work on getting it compiling with a newer version of Visual Studio (VS) or through a makefile first then VS.

I can do Sunday from 3 Sep at Midnight GMT to 4 Sep 3AM GMT. (Same time Hooman and I have worked last several times). I can push later in the day 4 SEP if that is better for someone else. I'm also available some on Saturday if that works better than Sunday.

Quote
Anyway, would love a rundown of the submodules thingy you guys were working with. It's something I've been meaning to look at but never seem to have the time.

Leeor, I haven't forgotten about this. I'll try to make some time perhaps in January if your interest holds. It isn't too difficult when you start doing it regularly.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on November 07, 2017, 11:40:39 PM
Sounds like a plan.

... though you might want to check the Calendar ;)

I assume you mean this time:
https://www.worldtimebuddy.com/?qm=1&lid=0,1668341,1668341&h=0&date=2017-11-13&sln=0-3 (https://www.worldtimebuddy.com/?qm=1&lid=0,1668341,1668341&h=0&date=2017-11-13&sln=0-3)

I'm guessing the project has yet to be compiled under a current version of Visual Studio.
Title: Re: Remote Pair Programming
Post by: Vagabond on November 08, 2017, 11:08:57 AM
Hooman,

Sorry, you are correct. Sunday, 12 Nov midnight GMT to 13 Nov 3am GMT.

No I have not started porting it to a neweer version of Visual Studio. I was wanting to wait until the current code base was pushed to Git. I may have some time to try to Port beforehand though.

Brett
Title: Re: Remote Pair Programming
Post by: Hooman on November 11, 2017, 06:20:11 AM
The op2ext project has been pushed to GitHub:
https://github.com/OutpostUniverse/op2ext.git
 (https://github.com/OutpostUniverse/op2ext.git)
Title: Re: Remote Pair Programming
Post by: Vagabond on November 12, 2017, 12:55:21 AM
Thanks Hooman for pushing to GitHub.

I'm using a different CPU than last time, so hopefully everything works well.

I'll plan to find you on the Outpost Universe mirc room. Backup will be Discord.

-Brett
Title: Re: Remote Pair Programming
Post by: Vagabond on November 13, 2017, 12:43:58 AM
We completed another successful pair programming today. Check out the thread http://forum.outpost2.net/index.php/topic,6045.msg85715/topicseen.html#new for details of the progress.

Lag was noticeable today. It was bad enough that it made it difficult for Hooman to program at times. (He was the one remoting in to my CPU).

In retrospect, maybe we should have tried lowering my screen resolution to reduce the pushed bandwidth. My newer CPU has a resolution of 1920x1080, which may not have helped?

I'm not sure internet bandwidth is the problem since I'm able to stream high resolution videos without any lag.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on November 13, 2017, 01:07:21 AM
I'd like to point out the main lag issue was simply with the mouse cursor, and that was only after adjusting some setting. Previously, the mouse cursor would be invisible over certain windows. It was a choice of either a laggy mouse cursor that was always visible, or a reasonably responsive mouse cursor that would sometimes be invisible.

I also noticed a slight delay in the audio. I could see Vagabond type something, and hear him still typing it after he'd finished typing.

It was still a very workable session though.
Title: Re: Remote Pair Programming
Post by: Hooman on December 15, 2017, 10:19:17 PM
Just checking when our next session is. And prodding other people that might want to give pair programming a try.

In particular, any plans for December 18th, 00:00 GMT (midnight/Monday morning GMT, Sunday night North America)?
Title: Re: Remote Pair Programming
Post by: Vagabond on December 16, 2017, 03:32:36 PM
Hooman,

Thanks for the prompt. I hadn't posted yet because I was still working through a venue. I'm going to try this session from a library conference room. My wife and kids are kicking me out of the house for the afternoon.

I would like to move the session 1 hour earlier than usual, so starting at 17 December, 11PM GMT. I have a library room booked for a 2 hour period. After that, we could work another hour in the library itself which would probably mean chatting back and forth an not using Team Viewer.

Also, their internet connection may not support Team Viewer bandwidth as I've never used it for this. Just setting expectations...

First project: Trying to fix minimap colors when using non Outpost2 specific BMPs with the Map Editor. (I'm bringing almost zero knowledge of bitmap file structure to the session, FYI).

If that goes quick enough, we can locate and document where the version number and copyright year are set for display on the Outpost 2 ABOUT page.

The other option for a second project is start designing a module for Outpost 2 to serve as a test-platform for op2ext. I'm thinking we can just output debug messages within the IDE displaying results to ensure all the hooks and C ABI export functions are working. This could continue into actually using GoogleTest on the project. Since I've never actually written a module, I'd rather focus just on that instead of bringing in GoogleTest though...

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on December 16, 2017, 11:34:14 PM
Ok, I've set my alarm to wake up an hour earlier.

I'm hoping the map editor fix will be quick and easy, though we'd need to verify the source of the problem first, which could lead to surprises.

For the version number, it might help to have OllyDbg pre-installed, and a copy of the .udd file from the repository available. No guarantees we'll need it, but that's usually the tool I use when investigating the exe.

Will need to keep in mind there was an exe mod that invalidates the .udd file. I've been using SVN revision r915 for the Outpost 2 game download, as that is before the exe was modified/resized. I tagged that revision in my git-svn clone to make it easier to work with.

Trying to do the above, and then write a module for the first time, and unit tests does sound a bit ambitious for one sitting. We'll likely have to prioritize there, in which case trying to write a module and do manual testing is likely the place to start.
Title: Re: Remote Pair Programming
Post by: Vagabond on December 17, 2017, 12:25:41 AM
If we can cleanly fix the mapper in a single session, I'll be happy. The rest is just sort of a laundry list of where I'd like to go eventually.

I have Ollydbg on my CPU and the full SVN repo. We will have to pull the files manually from r915.

-Brett
Title: Re: Remote Pair Programming
Post by: Vagabond on December 17, 2017, 11:59:15 PM
During the last session Hooman and I managed to get OP2Editor (the backend for the OP2Mapper) compiling using Visual Studio 2017. We made some general updates to the OP2Editor repository to clean up what is posted.

When loading the OP2Mapper using the newly compiled OP2Editor.dll, the program loads fine and opens vol files. However, when loading a map file into the mapper, OP2Mapper.exe crashes. We were not able to pinpoint the cause of the crash. We never got to actually trying to fix the bug.

Visual Studio 2017 was also appearing to stall out during the compilation of OP2Editor.dll. Visual Studio would continue to run fine, but it would never finish actually compiling the DLL. After some fiddling, it started compiling again although we never figured out what the problem was in the first place.

I did learn some basics about Microsoft COM/MIDL compiler and the Git squash command.

In the short term for me this effort has stalled out. I don't have the skills to continue troubleshooting the new bug without compiling the OP2Mapper 2.2.1 source code. This code is written in Visual Basic, a language I have no experience with.

Blackbox mega thread of goodies: http://forum.outpost2.net/index.php/topic,4909.msg71732.html#msg71732

Hooman mentioned getting the mapper's front end code into the repository, which seems like the next logical step.

-Brett

--------------------------
EDIT

I deleted OP2Editor from the SVN repo to reduce number of copies of the codebase floating around.
Title: Re: Remote Pair Programming
Post by: Hooman on December 22, 2017, 06:47:03 AM
I gave this a bit of a go in a VM.

If you run Mapper2 with debugging (F5), it will crash when you open a file. If you run Mapper2 without debugging (Ctrl+F5), it opens and runs normally. I have not investigated the cause, but felt this was worth mentioning.

Running Mapper2 straight from the source package wasn't working for me. I got a bunch of errors from unregistered components. After registering them, I still got a cryptic "Run-time error 440". I eventually tracked down an installer for Mapper2, and after running that, the copy from the source package was able to run. I'm not sure what setup the Mapper2 installer does, but it'd be nice how to replicate it in a development environment, or details on how the installer was made.
Title: Re: Remote Pair Programming
Post by: Vagabond on December 23, 2017, 03:34:05 AM
Hooman,

I just tried running without the debugger and can confirm it works on Visual Studio as well. Should have thought about that during our pair programming session!  :(

When using the debugger, I tried playing with the debugger's working directory by setting it both to the location of OP2Mapper.exe and where I was pulling the map/wells from. Either way, it didn't seem to help.

Now that it is working, have you taken a crack at fixing the actual bug yet?

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on December 29, 2017, 09:51:53 AM
I did some fairly rudimentary testing, but didn't come up with anything. Doesn't seem to be related to the 5/5/5 or 5/6/5 RGB bit encoding idea I had earlier. Though that's not a big surprise since it's using 8-bit palette based bitmaps, and not 16-bit color, so that branch of code isn't run.
Title: Re: Remote Pair Programming
Post by: Vagabond on December 29, 2017, 06:29:18 PM
I'm planning on actually playing some Outpost 2 this coming weekend, so probably no pair programming.

I may be able to swing 7 January, 11PM GMT if there is someone else with availability.


My priority would currently be locating and documenting where the version number and copyright year are set for display on the Outpost 2 ABOUT page.

Not sure if Hooman wants to work more on the OP2Editor minimap bug in a pair session now that we have the code running (even if the debugger isn't attached).

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on December 31, 2017, 06:05:47 AM
Have fun. I plan to sleep in New Year's Day.

The version number is probably the best thing to work on. I assume you mean change the year for the modifications done by OPU. I'd be very hesitant to change the original copyright year info.

I may look into the OP2Editor minimap bug on my own.
Title: Re: Remote Pair Programming
Post by: Vagabond on January 02, 2018, 04:49:37 PM
I just want to change the version number, not the copyright year. Could have been more clear in my post.

-Brett
Title: Re: Remote Pair Programming
Post by: Vagabond on January 06, 2018, 01:47:55 AM
I'm available 7 January, Midnight GMT if there is someone else with availability.

As discussed, I'll be looking to figure out how to set the version number on the ABOUT page in the main menu primary.

Secondary if time permits would likely be trying to record a bit of Team Viewer and see how it turns out.

Or, open to other projects if people have other things they would like to work on.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on January 06, 2018, 08:02:55 AM
I've marked the time in my calendar.


I've also recently had a couple of pair programming sessions to recreate the main menu of Outpost 2 as an HTML page. Bit of a silly project, but good fun, and a good review of CSS. The project was visual only, no actual links or functionality, though the buttons do highlight like in the game if you click them (using the CSS a:active pseudo-class).

If people have any silly learning projects they want to try, feel free to suggest something. And remember these sessions are open to more than just 2 people at a time.
Title: Re: Remote Pair Programming
Post by: Vagabond on January 06, 2018, 08:04:50 PM
Sounds good, I'll jump on the quakenet mirc forum room as usual and use Discord as a backup if mirc isn't working.

-Brett
Title: Re: Remote Pair Programming
Post by: Vagabond on January 07, 2018, 10:37:52 PM
Hooman,

I missed you during the session today. Fortunately, _A_ new exactly how to change the about screen version number via Resource Hacker, so that was quickly solved. Thanks to _A_ for the help.

_A_ and Daver helped a lot teaching me how to actually use NetFix and NetHelper, which was much appreciated. Thank you both. I'm still going to need to fiddle with it some more. Part of the problem is the lack of a readme for NetFix and the other half is my complete lack of understanding modern networking.

We also had a productive conversation about the difficulties involved in automating terrain transitions for Outpost 2 with a possible solution to ease the difficulty. Thanks to Leeor, _A_, and daver for their insights.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on January 08, 2018, 01:13:27 AM
Terribly sorry about missing the pairing. My fault, I marked the wrong time in my calendar, and also didn't ensure adequate rest. I woke up an hour too early, didn't see you around, and having nothing else planned, managed to fall asleep again before the appointed time. I only just now noticed your last message said midnight GMT, as opposed to the 11pm GMT from the earlier message.

I should really pay more attention to sleep before those early morning sessions.


In regards to Resource Hacker, that is a very useful tool for extracting resources such as bitmaps, icons, and dialogs. It also makes for a more user friendly editor than a hex editor. Though be aware that some resource editors will repack the resources when saving, which can move stuff around. Generally this shouldn't matter, but it can result in file size changes, which can have unexpected effects. If you're going to use resource editor, it might be a good idea to check there were no file size changes, or possibly even verify that it only actually changed the part you think it changed.

NetFix could use some usability improvements. For instance, displaying both the internal and external IP. Using only 1 open socket internally, rather than one unbound socket and potentially one bound socket (ForcedPort). The log output could also be improved, which might help diagnose network difficulties. Maybe we could look into some improvements sometime in the future.

The map editor terrain transitions is something I badly want. It's a messy problem, as I'm sure you know. This should probably be a much bigger priority than we've given it.
Title: Re: Remote Pair Programming
Post by: Vagabond on January 09, 2018, 12:23:24 AM
Hmm, I should have emphasized the time change I made in retrospect.

I'm unavailable this coming Sunday, so perhaps in 2 weeks for my next participation.

Didn't mention in the last post, but it was nice that people seemed generally excited on the forums about continued work on Outpost 2 even though a lot of the work is mundane right now.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on January 10, 2018, 05:10:28 AM
I know. It's so much more motivating to work on stuff when you hear more than just crickets.
Title: Re: Remote Pair Programming
Post by: Vagabond on September 20, 2018, 08:55:49 PM
Hooman and I participated in another pair programming session yesterday. It had been quite a while. We used the newer version of Team Viewer (v13), in which we were unable to get the voice dialog to work. Discord filled in nicely for audio while we used Team Viewer for the screen sharing. Also, when we were using the Linux desktop, I was unable to control the mouse/keyboard. When we used the Windows desktop, Hooman was able to remotley control things. Not sure if this was a bug or user error.

We focused on extending our knowledge of the op2_art.prt. op2_art.prt contains all of the imagery metadata for Outpost 2 on how animations work, how frames are overlayed on top of each other, etc. It seems like a pretty sophisticated system for when it was created, although I doubt it would be useful now that more computing power is available.

We had already created new code on OP2Utility that allows for reading and writing op2_art.prt. However, I couldn't get the end of the writing routine to work.

After teasing out a small bug in the ArtWriter class, we were able to produce an exact replica of op2_art.prt. Except our replica stopped early. Turns out op2_art.prt stores more data after the animation structure array. It appears to be at least 2 more structure arrays and some more small fields at the end. We had to stop the session before finding anything in detail out about the new data.

I thought it was productive overall, especially considering that we were making progress with the TeamViewer shortcomings and the unintended background noise issues.

Unfortunately, I didn't get to dive into OllyDbg myself as much as I wanted to, but perhaps another session sometime for that.

The ArtWriter bugfix hasn't been pushed to GitHub yet. I'll plan to clean that up tomorrow. At some point, I'll also post in a different thread updating the new features in OP2Utility.

-Brett
Title: Re: Remote Pair Programming
Post by: Hooman on September 30, 2018, 04:09:44 PM
In regards to the extra data at the end of the Prt file, it is not loaded or used by Outpost 2. We have found extra unused data. This is very similar to the tile group data at the end of map files. The game never tries to load it. There is no code to analyse how the data is loaded or used, because it isn't loaded or used.

I spent some time examining the code we were looking at in OllyDbg. Turns out the code at the end of the Prt loading method corresponds to the UnknownContainer struct array, defined in Animations.h in the OP2Utility project. That particular code corresponds to data that is already being loaded, we just don't yet know what to do with that part yet.

The Prt loading method in Outpost 2 closes the stream and ends after loading the animation array. It never touches the data after that.

The only way to determine what that data means is to analyse the data itself.



In terms of the structure of the UnknownContainer, I strongly believe it represents a Rect. More specifically, I believe it represents two Point objects.

The reason for this conclusion is the peculiar and somewhat nonsensical stream error checks around that code, where it reads the first 4 bytes, and then conditionally loads the next 4 bytes, provided there were no errors from reading the first 4 bytes. As the only expected error might be end of file, it could have just tried to read all 8 bytes together.

This error checking behavior is consistent for other parts of the code that process Point structs. In particular, the clipRect struct exhibits the exact same checks. My guess is, the game's code had an inline method which read the x and y fields of the Point object separately, and returned early if there was a failure. It may have even returned an error code to indicate success or failure. Though the problem with returning error codes is they are inconvenient to check, and make a mess of the control flow of the program. As such, they are frequently ignored. That may explain the pattern in the code, which seems to be repeated for each Point or Rect that is loaded.

Possible example code:
Code: [Select]
/* Returns true if read was successful */
bool StreamIO::Read(void* buffer, std::size_t size);

/* Returns true if read was successful */
inline bool StreamIO::Read(Point& p) {
  /* Note: The && is short-circuiting */
  /* It only evaluates the right hand side if the left hand side is true */
  return Read(p.x) && Read(p.y);
}

/* Returns true if read was successful */
/* ... or get lazy, not check things, and return void */
inline void StreamIO::Read(Rect& rect) {
  Read(rect.p1);  /* Ignore return value */
  Read(rect.p2);  /* Ignore return value */
}

The Rect class doesn't seem to use the same short-circuiting behaviour. If one point fails to load, it still tries to load the second point.