Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Hello lonley Cog forum.
Hello lonley Cog forum.
2007-05-18, 9:39 PM #1
*Listens to echo of post through empty threads*
2007-05-19, 4:11 AM #2
There is no echo command in cog. You can use Print or the jkString* functions, though.
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2007-05-20, 1:09 PM #3
I miss writing cogs.
2007-05-20, 4:02 PM #4
Maybe I should write a perl script that generates cog scripts on the fly.... :ninja:
And when the moment is right, I'm gonna fly a kite.
2007-05-25, 4:32 PM #5
Or a perl cog parser/syntax checker!
-Hell Raiser
2007-05-29, 3:08 AM #6
[http://www.jkhub.net/project/screens/project-13-RUpZPXtPJO.jpg]
I'm going for a C# implementation myself.
2007-05-29, 4:05 AM #7
Waaaaay ahead of you. :P
[http://shauri.org/cogpad/img/cogpad3_syntax_small.png]
And when the moment is right, I'm gonna fly a kite.
2007-05-29, 5:56 AM #8
Ah, but can CogPad edit levels as well?
[http://www.jkhub.net/project/screens/project-13-CBTAmtmdHC.jpg]

[Disclaimer: JKW can't either at the moment :p ]
2007-05-29, 5:44 PM #9
Originally posted by Giraffe:
Ah, but can CogPad edit levels as well?...

Well, no, of course not. Right tool for the right job. :P
And when the moment is right, I'm gonna fly a kite.
2007-05-29, 7:36 PM #10
lol
-Hell Raiser
2007-05-30, 12:26 AM #11
Originally posted by gbk:
Well, no, of course not. Right tool for the right job. :P


Touché, sir. :)

I think we've found a way to integrate the many tools in an intuitive way, although there's a long way to go with these tools (cog editor is getting to the point where it's almost as good as Notepad, level editor can only display a wireframe of sectors, and no other tools actually exist yet).
2007-05-30, 7:16 AM #12
I love the button labeled "button1".
2007-05-30, 11:07 PM #13
Originally posted by Giraffe:
I'm going for a C# implementation myself.
so how are you handling the fact that JK allows you to use keywords as symbol names? (which appears in a number of LEC COGs)

when you build the semantic tree for code completion how are you going to handle template differentiation?
2007-05-30, 11:21 PM #14
Heh, only on the cog forum can a troll post turn into a disturbingly on-topic discussion.
"it is time to get a credit card to complete my financial independance" — Tibby, Aug. 2009
2007-05-30, 11:46 PM #15
Originally posted by Jon`C:
so how are you handling the fact that JK allows you to use keywords as symbol names? (which appears in a number of LEC COGs)
You know, I don't understand this obsession with getting the untouched original game files to work perfectly with new engines/editors. I think it's perfectly reasonable to expect to run some kind of cleanup tool before using a modern JK program.
Dreams of a dreamer from afar to a fardreamer.
2007-05-31, 12:04 AM #16
Originally posted by Fardreamer:
You know, I don't understand this obsession with getting the untouched original game files to work perfectly with new engines/editors. I think it's perfectly reasonable to expect to run some kind of cleanup tool before using a modern JK program.


exactly how much 'cleanup' are we talking about?

As long as you're only doing syntax highlighting it is a minor thing. If you're looking to add features like code completion, autotabbing and basic refactoring the number of changes you need to make in order to have an elegant (i.e. realtime) solution grow longer and longer. Even with a language like C#, which can be parsed very quickly and in a single stage, you need to maintain a rather sizable database in order to implement these features.

In order to make COG a 'good' language - that is, one that is not context-dependent - it would require changes significant enough that it would no longer function with the original JK executable. At that point you really have to ask yourself why you are making it in the first place.

I will suggest, however, that if Sith 2 hadn't used JK resources it would be done by now.
2007-06-12, 6:28 AM #17
Originally posted by Jon`C:
so how are you handling the fact that JK allows you to use keywords as symbol names? (which appears in a number of LEC COGs)

when you build the semantic tree for code completion how are you going to handle template differentiation?


I'm not that far into it yet. I'm still struggling with the idea that symbol declarations are line-break-terminated, and the code section is semi-colon-terminated.

And // style comments are only allowed in the code section. WTF?

I'm currently planning to handle keywords as symbol names (which I wasn't aware of, thanks for the tip) by having a dumber lexer that won't attempt to differentiate between identifiers and keywords, and attempt to figure out which they are in the parser. We'll see how that works out. :suicide:

As to the other point about template differentiation... It's been a while since my compiler course at uni, and I've not actually tried to write anything like it since... what do you mean by template differentiation for code complete?

Originally posted by Jon`C:
I will suggest, however, that if Sith 2 hadn't used JK resources it would be done by now.


Can I ask one thing of you? PLEASE PLEASE PLEASE stop getting hung up over this. No-one* is blaming you or thinks any less of you because you quit working at a project that very few others even attempted, and even fewer (no-one?) got anywhere near as far as you and Sige (and anyone else). If you're ever tempted to pick up Sith2 and rework the idiosyncracies of the Sith engine out of it and create a compelling alternative engine, I'd love to see that and help out in anyway I could (although I'm more of a C# coder than C++, I'm enough of a coder to pick up enough to contribute some code, alternatively I could write helper apps in C# - something like JKW for creating content, or a utility to cleanup JK files enough to be able to run in the new engine perhaps?). Anyway, I'm not really sure what I'm saying anymore, so I'll stop this rambling.

* that is, no-one with an opinion worth anything :)
2007-06-12, 11:08 AM #18
Symbol declarations are newline-terminated, //-style comments are allowed in the code section, keywords as symbol names are allowed, template names cannot be differentiated from identifiers (in many cases) because JK parses COGs in the most stupid way possible.

COGs are parsed in two passes. They used something similar to the Dark Forces INF parser for the symbols section (which is basically what COG was, originally) and then tacked on a copy+pasted C BNF for the code section.

In addition to the usual assortment of literals, in the symbols section you can have template literals which are not delimited in any way. There are also a number of unhandled syntax errors in various LEC COGs (like invalid desc metadata) so you're looking at a whole lot of typing if you do the whole thing with a parser generator.

To fix the symbol name = keyword problem I ended up manually parsing the symbols section (like JK does) and feeding the result into the tokenizer (like JK probably does). Unfortunately that meant searching through the symbol table every time I hit a keyword token but that's JK for you! :awesome:

Originally posted by Giraffe:
Can I ask one thing of you? PLEASE PLEASE PLEASE stop getting hung up over this.
I'm not really hung up about it, I enjoy using it as a symbol to represent how bad JK's design is.

If I were to pick up the project again the data files would be so different that it wouldn't really be possible to convert JK's content. Among other things, 3dos and keys would be completely scrapped. So would COG. It'd be so different that anybody who worked on it would get sued for creating an unlicensed Star Wars game (instead of getting a C&D at the 11th hour like what would have happened with Sith 2).

Also, it'd be written in C# and it wouldn't use OpenGL. I love me some XNA.
2007-06-13, 6:47 AM #19
Yeah, but what about settling for something in between? Rather than trying to make a JK anomaly fit in with the rest of the architecture, attempt to fix it ahead of time with a host of cleanup/translation utilities, and if that fails, 'quarantine' it in a way that allows the resource to still be loaded (even if it means visual or functional glitches). This way the engine could handle 95% of JK content instead of 100% or none at all.

Disclaimer: this is just a theoretical question. I'm in no way implying you should rework Sith2 in any way.
Dreams of a dreamer from afar to a fardreamer.
2007-06-13, 3:48 PM #20
notlegalinmoststatesvoidwhereprohibited :saddowns:
-Hell Raiser
2007-06-14, 4:54 AM #21
Originally posted by Jon`C:
COGs are parsed in two passes. They used something similar to the Dark Forces INF parser for the symbols section (which is basically what COG was, originally) and then tacked on a copy+pasted C BNF for the code section.


Yeah, the more I look at it, the more horrors crawl out of the woodwork.

Originally posted by Jon`C:
so you're looking at a whole lot of typing if you do the whole thing with a parser generator.


I'm avoiding using a parser generator for this, as it's also a learning project for me.

Originally posted by Jon`C:
Also, it'd be written in C# and it wouldn't use OpenGL. I love me some XNA.


XNA is the Game Studio stuff, right? I've not got around to having a look at that stuff yet, but I did start writing a physics engine in C#, half as a(nother) learning project, half to see if C# was capable of running something like that which would traditionally be where C or C++ shone. I found that C# was perfectly fine for the task: it was me that was sadly lacking in ability :(

↑ Up to the top!