Planning to convert a large program to C-Lite?

Posted By: Locoweed

Planning to convert a large program to C-Lite? - 02/21/08 04:31

Don't do it!

A large program being 100,000 lines of code or more, hundreds of resources(models, bitmaps, etc) with high Nexus (200+), and many dll's and such. It is just too much of a pain in the arse. Just wait until your next project and start a virgin program with C-Lite.

After about a month plus of converting to even get it to compile (and never getting it to compile on lower end machines that worked with C-Script), googles of crashes with no errors (those being Windows crashes), hunting those crashes with no idea what caused them except for thousands of diag()'s in code (basically using diag()'s as a bubble sort to find where it crashed, usually dll related, but not always), and having put in so much time you really have no choice but to get it converted, you will eventually realize it wasn't such a good idea after all.

Trust me.


Later,
Loco

P.S. I am not saying it can't be done, but I don't see the gains versus the problems I have had being worth the trouble to convert a very large program at this time. Just too much trouble and not even sure now that I have all running correctly in Test Runs with SED or WED whether I can get the very large program to Publish with C-Lite correctly just yet, which is also somewhat worrisome.

And yes, I can convert little programs of 10,000 codes or less from C-Script to C-Lite in a day or two and publish them no problem. So if you have a small program I suggest converting it, although you will still have to learn quite a bit before you can do that in a day. While you are learning the process, it might take you a week or more the first time.

Posted By: zazang

Re: Planning to convert a large program to C-Lite? - 02/21/08 05:06

well I too started of conversion of a c-script game to lite-C but so far the compiler has been fairly accurate in telling the changes that need to be done.
Are you talking about conversion from C/c++ projects to liteC ?

regards
zazang
Posted By: Locoweed

Re: Planning to convert a large program to C-Lite? - 02/21/08 05:16

Hi zanzag,

No, I am talking C-Script to C-lite.

How big is your program, how many resources do you have, what Nexus do you have to have to run program in C-Script, and are you running many dll's with program?

I am saying don't waste time trying to convert a very large program, not small or medium ones.

I mean just the conversion process for let's say changing 100 panels to
panel* = and changing all the some_panel.visible = on; and
some_panel.visible = off; in code to
set(some_panel,VISIBLE); or reset(some_panel,VISIBLE)
(or even some_panel.flags |= VISIBLE; if you like) can take days if you have a 100 panel definitions.

------------
Lol, heres one of many for you, use
set(some_panel,VISIBLE);
and accidentally forget the ; at end like
set(some_panel,VISIBLE) or set(some_entity,PASSABLE)
which easily happens coverting large programs and see what C-Lite tells you after compile crashes
compiling......................................................
Aknex.exe Encoutered a Error, must Puke and Shutdown - Woot!
(I am always tempted to send that error report to Microsoft when it asks)
with no error and no data and try to find that line of code in 250,000 lines of code then you will start to get the idea.
If you didn't know the line of code because I told you the line of code, think about finding that without nothing to go on.
That wasn't even the worse one, but that is an easy one to test out yourself. Leave the ; off of set() or reset(), see what info C-Lite gives you on that. No biggie with 10,000 lines of code, disasterous to find with 100,000 + lines of code.
The perverbial find the needle in the haystack baby. All you know is the compile crashed and you have to start commenting out all the included files, then once you find the file, then try to find the function by commenting them all out one at a time, then once you find the function then you have to find the line (and every time you comment out a included file or function it effects something else resulting in different errors). Not much fun when you have tons of code and this is only the compile phase. Not much fun at all.
-------------

Anyhow, I was talking about very large programs. I have just been frustrated with conversion of this very large program and even after I get it running well in test runs, not even being sure if I can get I to publish after what will soon be months of work (Of course, the program itself is like 3 years of code, 700mb, and oh 500 resources or so in it). I have converted many smaller medium programs like my Locoweed's Multiplayer tutorial in short order with no problem.

I am done talking about my frustration, it is just a warning for people considering converting large programs over to C-Lite.

Niters,
Loco
Posted By: zazang

Re: Planning to convert a large program to C-Lite? - 02/21/08 06:11

Aha I think Your program is way too large than mine !

I have 36 c-script files with on an average 500 lines each
which means around 18000 lines in all.Its a LABORIOUS task really
but we plan to use the same code in another future project with new cool
features of liteC,so we just have to do it.The worst of all
this conversion part is changing flags like my.invisible to
a set(my,INVISIBLE)...After the entire conversion is done,then we have to check
if everything is as good as it worked in c-script..Hopefully that wont be
a big pain:P
Posted By: Locoweed

Re: Planning to convert a large program to C-Lite? - 02/21/08 06:20

Yeah zazang,

I am not telling people not to convert, because after I converted some smaller programs, I saw a noticeable difference in performance for the good, especially fps, which is why I decided to convert the larger program. I am just warning people after they convert some small and medium projects and think, wow, let's convert the larger project. to seriously consider if it is really worth it. Because once you start and invest all the time in it, it gets to a point you have to try to finish it off, even though the gains end up not being worth the time you spent to do it. It will become very time consuming. I was converting for a month before the dang thng even ended up compiling, and I wasn't really sure if I would ever get it to compile. Now after that, I thought the hard part was done, but still trying to change and get all dll's and other stuff working and parameters right has been just as tough, with many other quirky stuff.

Sincerely,
Loco
Posted By: D3D

Re: Planning to convert a large program to C-Lite? - 02/21/08 06:21

Would worry more about compile time during conversion
Posted By: Locoweed

Re: Planning to convert a large program to C-Lite? - 02/21/08 06:52

I will give one example of many that will get you the dreaded Aknex.exe Crashed after the compile process is done also. Might help someone.

Old dll stuff will get you crashed with no warning very easily. Not to mention the changing of the dll code itself.

C-Script Version:

Let's say we had an old dll function declared as
dll_function SendString(some_string);
string temp_string;
now we call the SendString function with
SendString(temp_string);
or
SendString("Hi Mom!");
This works fine in C-Script.


C-Lite version of dll function:

function SendString(STRING* some_string);
STRING* temp_string = "#16";
now we call SendString function with
SendString(temp_string); // this is ok
or
SendString("Hi Mom!"); // Oops, we get one of those damn Aknex crashes with no data on this line
it should be
SendString(_str("Hi Mom!")); // this is right

But if you don't get it right, don't expect C-Lite to tell you what happened because it won't. You will have to hunt this line of code down in your own slow painful way.

This is not the only post compile aknex.exe crash with no info you can get, there are quite a few, but just a common one that might help others when it comes to passing temp strings to dll functions.

Now I am done, off to bed,
Loco
Posted By: Thiago_7

Re: Planning to convert a large program to C-Lite? - 02/21/08 09:47

The find and replace option doesn't help?

Did you do that game alone? It took 3 years?
Posted By: ventilator

Re: Planning to convert a large program to C-Lite? - 02/21/08 10:48

the lite-c crashes with no helpful information really are horrible. debugging in SED is a pain too. for example if the engine crashes SED quits and you have to load everything again. i hope this gets improved soon.

i had many problems because my and you behave differently in lite-c and that i didn't write the original code myself didn't really help either.
Posted By: Excessus

Re: Planning to convert a large program to C-Lite? - 02/21/08 11:40

Quote:

i had many problems because my and you behave differently in lite-c



Could you expand on that? What's different?
Posted By: ventilator

Re: Planning to convert a large program to C-Lite? - 02/21/08 12:00

function changeme()
{
me = NULL;
}

action test()
{
changeme();
// in c-script me will still be valid here
// in lite-c me will be NULL
}
© 2024 lite-C Forums