• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

vtwin

Python is King

14 posts in this topic

Python is King. Is that enough to start another thread?
def insert (self, key):
  if self.tree:
     self._insert (self.tree, key)
  else:
     self.tree = node(key)
 
Python is outrageously fun. Why do we need this thread? Well, all of us Lounge Python Penguins would like to discuss Python. Discussions never get enough detail in the General Programming Forum. I''d like to discuss (and debate) Python here. Everything. Not just through HTTP. Not just ActiveX. Not just through OpenGL. Not just databases. All of it. I want people who disagree with Python or despise it to participate. I want people who advocate it to participate. I want people to share Python snippets of code. I need this. I am no Python expert myself when it comes to programming in Python. But I''m not an expert with regard to much of what has been accomplished with Python, either. A good thread to raise Python awareness would be great. But not specific to any particular problem domain or contentious topic. Yes, we can encompass all of that, and go off on topics with regard to those subjects, but let''s not limit ourselves to one domain.
0

Share this post


Link to post
Share on other sites
Imitation is the sincerest form of flattery. Did you know that I made the first ultimate thread as well? Now we're going to see King threads.

Anyway, a Python thread is a wonderful idea. However, regarding the royal lineage, I think it breaks down like this:

Lisp is King.
Python is Prince.

This seems clear. Lisp is the father, and Python is the son, who strives to one day fill his father's shoes. However, it isn't clear that Python is heir to the throne. Python is more like a snake in the grass.

By the way, I'm not entirely sure what a Lounge Python Penguin looks like. I might better be able to visualize a Lounge Python Snake.

Now, on to the discussion of Python, its merits, and shortcomings, and how it is striving to fill its father's shoes.

[edited by - bishop_pass on March 11, 2003 5:06:26 PM]
0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
Imitation is the sincerest form of flattery. Did you know that I made the first ultimate thread as well? Now we''re going to see King threads.


How long until the Ultimate King thread shows up ?



[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
Imitation is the sincerest form of flattery. Did you know that I made the first ultimate thread as well? Now we''re going to see King threads.


Yes. And did you know I made the second Ultimate Thread, (in other words) the first to imitate you. You should feel very flattered!.. or something.

Anyway, personally I''d perfer Python''s syntax over Lisp''s anyday..but my knowledge of Lisp essentially ends with semantics.
0

Share this post


Link to post
Share on other sites
quote:
Original post by vtwin
Yes. And did you know I made the second Ultimate Thread, (in other words) the first to imitate you.

Actually, munkie has that dubious honor. But please, let''s not turn this thread into a meta-thread which discusses itself just like a Lisp program might be inclined to do. We should be discussing Python.
quote:
Original post by vtwin
Anyway, personally I''d perfer Python''s syntax over Lisp''s anyday..but my knowledge of Lisp essentially ends with semantics.

But does this help or hinder you? Part of the idea of Lisp is to get it to modify components of its own program at runtime, which means it needs to be able to pick it apart at runtime.
0

Share this post


Link to post
Share on other sites
SHilKazHatGame uses python scripting. It''s built right into the object system. Very pretty
0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
By the way, I''m not entirely sure what a Lounge Python Penguin looks like. I might better be able to visualize a Lounge Python Snake.


It is really simple.

First image the penguin. Now give the penguin a silly walk--one not suited for it. Now, have this penguin start yelling "NI!" at people it does not like, and whistling to itself, ''Every Sperm is Sacred,'' ''I bet you they won''t play this song on the radio,'' ''Always look on the bright side of life,'' and ''the Ballad of Sir Robin the Brave.''

(I think you can now figure out what the langauge is named after)

As for Python''s advantages:
My major reason for switching from Perl, was the fact that Perl4 code is still found all over. Perl5 was released in 1996... so I guess with them working on Perl6, I do not want to attribute to Perl5 existing a good seven years of Perl6''s life.

For the most part, Python is a clean version of Perl with a decent OOP implementation (rather than Perl5''s quick hack of an OOP implemenation).

-=-
I think signatures are unprofessional.
Dude! You''re getting a signature virus!
0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
Actually, munkie has that dubious honor.


Just to clarify..I am Munkie (well, before the account was hijacked). I''m not sure if my IP has shifted since then, but you can ask Drew or Dave for verification. Heh, whatever, anyway, back to the topic..

quote:

But does this help or hinder you? Part of the idea of Lisp is to get it to modify components of its own program at runtime, which means it needs to be able to pick it apart at runtime.


Personally I''ve never needed to employ something of that nature, so Lisp''s ability to do so has no bearing on me. Like I said, I have little experience with Lisp so my opinion is purely based on my history.
0

Share this post


Link to post
Share on other sites
Programming in python is a pleasure .

It''s got beautiful syntax, nice OOP design, and you can create working code nearly as fast as you type. Not to mention that it has an excellent set of standard libraries connected to it. I''ve used it for a few months now, for small things like utilities, for fun, and for some prototyping. Here''s a little tool i made that converts a binary file into a C array:


  
import sys

# dup( count, char )
def dup(c, s):
result = ""
for i in range( c ):
result = result + s
return result

# the main function
def main(i, o):
opened_file = file(i, "
rb")
output_file = file(o, "
w")
binfile = opened_file.read()
opened_file.close()
output_file.write("
/* file generated by : \n") # a little message =)
output_file.write(" bin2c (c) blueEbola 2002. */ \n\n")
output_file.write("unsigned int size = %d;\n" % (len(binfile)))
output_file.write("unsigned char data[] = { ")
k = 0
print "Converting... "

for k in range( len(binfile) - 1 ):
if k % 12:
output_file.write(`ord(binfile[k])` + ", ")
else:
output_file.write("\n" + dup(25, '' ''))
output_file.write(`ord(binfile[k])` + ", ")

print " done!"
output_file.write(`ord(binfile[k+1])` + " ")
output_file.write("};\n\n")
output_file.write("/* end of file: %s */
\n\n" % (o,)) # output some info
output_file.close()

# argument check
if len( sys.argv ) > 2:
main(sys.argv[1], sys.argv[2])
else:
print "
\nusage: " + sys.argv[0] + " <binary file> <output>"
0

Share this post


Link to post
Share on other sites
Damn, for a moment I thought this was going to be a *Monty* Python thread. Curse you!

NI!
0

Share this post


Link to post
Share on other sites
I know zippo about Lisp, and some VERY rudimentary facets of Python, but I did check out this site comparing Python vs Lisp

What surprised me was how slow Python was...I mean...it's..slower.....than............java(sorry ). Conversely, I was surprised at how fast Lisp was. Also, it mentions that basically Python is a dialect of Lisp with one crucial feature missing....macros.

Since I don't know Lisp, and therefore don't know what macros are, I'm not exactly sure how good/bad this is. From looking at the chart comparing the syntax...Lisp syntax does seem a bit odd, but at least it seems very consistent. Since basically both Lisp and Python are brand new to me, Python seems a little more intuitive to me...but I think I could pick up Lisp pretty easily from looking at it.

I'm thinking of tackling Python next because I hear it's good as a scripting language for game usage. Python supposedly has good hooks into C++, and it's also very extensible through its modules. Does Lisp offer the same features?



[edited by - dauntless on March 12, 2003 7:59:44 AM]
0

Share this post


Link to post
Share on other sites
ur link is messed up.
need to fix it.

also some C/C++ vs. Python code would be nice.
i like a good comparison.

honestly i could care less about speed and crap. i''m more
interested in good coding style and structure.
0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
Imitation is the sincerest form of flattery. Did you know that I made the first ultimate thread as well? Now we''re going to see King threads.



Sorry, you lose! Please play again, though.

The first ultimate thread:
The Ultimate Game Survey, started by Raz.

0

Share this post


Link to post
Share on other sites
quote:
Original post by bishop_pass
But does this help or hinder you? Part of the idea of Lisp is to get it to modify components of its own program at runtime, which means it needs to be able to pick it apart at runtime.

quote:
Original post by vtwin
Personally I''ve never needed to employ something of that nature, so Lisp''s ability to do so has no bearing on me. Like I said, I have little experience with Lisp so my opinion is purely based on my history.

What''s being talked about is introspection , which Python can do aswell. Only, it''s a lot more difficult with Python since, like all Algol-derivatives, it has a two-level syntax (or three-level, but we''re not interested in the bytecode representation). Once you have an environment which puts a layer of arbitrary syntax between you and the abstract representation of your program, anything that you want to do to manipulate the abstract representation immediately becomes an order of magnitude harder.

For example, imagine you wanted to create a class on-the-fly. In Python, internal representation of objects consists of trees built with recursive dictionaries, which is exactly synonymous with Lisp cons cell structures (a cons cell is a two-item pair, and so is a dictionary entry). So to create a class, you would have to construct the class dictionary, and instantiate the class from some metaclass. To illustrate:

  
def standard_initialiser(inst, x):
inst.x = x

def foo(inst):
print inst.x

def make_class(name, methods=[]):
classdict = {}
# add methods
for method in methods:
classdict[method.func_name] = method
# add constructor
classdict[''__init__''] = standard_initialiser

# "type" is the metaclass...
return type.__new__(type, name, (), classdict)

C = make_class(''C'', [foo])
c = C(10)
c.foo() # prints ''10''

So, it is easy to see that the Python syntax is far removed from the internal syntax of recursive dictionaries. In Lisp, you could achieve the same thing by building an s-expression and submitting it to DEFCLASS, where the s-expression *is* the abstract representation. i.e. you build the class the same whether you do it at runtime or compile-time.

It is easy to say that the ability to do such things has no bearing on you when your language makes it hard for you to think about them. I doubt that these abilities aren''t useful to you, just that the syntactic barriers in Python makes it harder to conceptualise how they might be useful.
quote:
Original post by Dauntless
What surprised me was how slow Python was...I mean...it''s..slower.....than............java(sorry ). Conversely, I was surprised at how fast Lisp was. Also, it mentions that basically Python is a dialect of Lisp with one crucial feature missing....macros.

There''s more features missing, but whether they are crucial depends on your point of view. For example, program compilation is not a standard feature of Python. Neither are declarations, which are useful for providing information to the compiler for optimisations. There''s also something extra that Python has which takes something away, and this is the extra layer of syntax I described above. Lisp''s syntax looks "funny" for a reason. To seamlessly add macros into Python, it would have to adopt a Lisp-style syntax, otherwise there would always be a syntactic barrier to building recursive dictionary structures. Since macros are about manipulating code as if it were data, you need the same representation for code and data.
quote:

I''m thinking of tackling Python next because I hear it''s good as a scripting language for game usage. Python supposedly has good hooks into C++, and it''s also very extensible through its modules. Does Lisp offer the same features?

Yes.
0

Share this post


Link to post
Share on other sites