Jump to content

Porting BoE to something cross-platform?


Recommended Posts

Last night I made another experimental attempt to start a CBoE Java port. I began with the PC headers, creating a PlayerCharacter class based on the existing PC class and filling in a bunch of empty methods. Then I created an interface for holding the numerous constants... After which I started filling in methods, basing my code on what I saw in the relevant C++ source file.

 

I got about halfway through the "kill" method before I realized I was doing something dreadfully wrong. Shortly thereafter I gave up.

 

Clearly I was not using the right approach. The code base is pretty dreadful to look at, and perhaps Java was not a good choice of language for the job; but it seems to me I could do better than this...

 

Does anyone here have experience with porting large programs from one language/paradigm to another? With refactoring big projects? What kind of techniques are usually involved? A top-down copy based on the existing program's data structures is not a good way to do this, I take it?

Link to comment
Share on other sites

Well, given the many numerous Bad Things happening in the code, it would definitely be prudent to remove some of said things while porting, rather than just rewriting the same things, but in a different language.

 

I did try to do some of that, though clearly not enough...

 

It seems to me that part of the problem is that the code needs a top-down redesign, which I don't think I have time or the know-how to pull off at the moment.

 

Edit: gods though, I think this code is hurting my sanity. I mean

 

typedef char Boolean;

 

seriously?

Link to comment
Share on other sites

  • 2 weeks later...

typedef char Boolean;

 

seriously?

This is actually standard C practice. Or at least, it was standard C practice before a real boolean type was added to the language in C99. At least it wasn't "typedef int Boolean;". :p

 

The BoE code does also use bitflags in some places.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...