The present invention relates to software application development platforms, and, more specifically, to a platform for game development that allows developers to create complex data types using a set of base types and persisting those complex data types to a variety of data storage devices without configuration by the developer.
Many of today's popular games are delivered over the Internet, specifically the World Wide Web. And these games are not just online versions of classic board games like tic-tac-toe or Scrabble; they are complex, dynamic, and persistent. Some examples of these include Neopets®, which lets users create and take care of virtual pets; Runescape, a fantasy massively multiplayer role playing game; and FarmVille, a game accessed through the social networking site Facebook, that lets players manage a virtual farm.
One downside of online games in general, including web-based games, is that they are developed typically to utilize a specific computer architecture. That is, they rely on custom-developed data types to store game data and then store that data using transport and data storing mechanisms that are hard-coded and fixed. If the developer wants to move from one storage mechanism to another storage mechanism, e.g., from a SQL-based database to a YAML document store, he must rewrite the persistence layer of his application. Further, if the new storage mechanism does not support the data types of the game, the developer must rewrite his game to use data types supported by the storage mechanism. This makes it difficult to port games using one architecture to another architecture.
The current invention provides a development and publishing architecture that provides a set of base data types that can be used to create complex data types, and provides an intelligent means of transporting and storing data, regardless of the target data repository. Beneficially this allows developers to first, quickly build a game using base types, including creating new data types using the base types and allows the game data to be transported and persisted to different storage formats with little to no modification of the code by the game developer. The game development and publishing platform described herein will be referred to as “Catapult.”
In one aspect, the invention is a method for providing a flexible development platform. The method involves providing a hierarchical data modeling system to a computer program developer, the hierarchical data modeling system including a plurality of data modeling system base data types and programming means to create one or more complex data types, each complex data type comprising the data modeling system base data types or a first structure class. The method also includes receiving, by a computer program language processor, a second structure class comprising one or more complex data types. A computer program language processor then inspects the structure class during pre-processing, and creates a reference to the one or more complex data types. Then, the one or more complex data types of the second structure class are encoded using the reference into a form expressed as the data modeling system base types. Then, the computer program language processor defines a relationship between the plurality of data modeling system base data types and a plurality of storage device base data types. Finally, the first structure class is stored in a storage device by storing the data modeling system base types of the encoded one or more complex data types in the storage device using the defined relationships.
There is also a system for providing a flexible development platform. The system includes a hierarchical data modeling system, which itself includes a number of data modeling system base data types, a structure class comprising one or more complex data types. There is also an encoding module. In the first structure class, each complex data type includes the data modeling system base data types or another structure class. The encoding module converts the one or more complex data types of the first structure class into a form using only the data modeling system base types.
There is also a computer program product, tangibly embodied in a non-transient computer-readable storage medium, e.g., on a disk, CD, DVD, on a hard drive, etc., for providing a flexible development platform. The computer program product includes instructions that are operable to cause a data processing apparatus, e.g., a computer, to provide a hierarchical data modeling system. The hierarchical data modeling system includes a number of data modeling system base data types, and a structure class that has one or more complex data types. Each complex data type includes the data modeling system base data types or a second structure class. There is also an encoding module provided to convert the one or more complex data types of a structure class into a form using only the data modeling system base types.
Any of the above aspects enjoy the following benefits. There can also be a first storage device, such as a database or a document datastore, that has a number of storage device base data types. In these embodiments, there is also a mapping that defines a relationship between the storage device base data types and the data modeling system base data types. There is also a first module for storing the first structure class to the first storage device by storing the data modeling system base types of the encoded complex data types in the first storage device using the storage device base data types based on the first mapping.
In some implementations of the above aspects, the first storage device can be replaced with a second storage device that has its own storage device base types (and can be a completely different type of storage device). In these implementations, the first mapping can be replaced with a second mapping that defines a relationship between the storage device base data types of the second storage device and the data modeling system base data types. Additionally, the first module can be replaced by a second module for persisting the first structure class to the second storage device by storing the data modeling system base types of the encoded complex data types in the second storage device using the storage device base data types of the second storage device, based on the second mapping. Beneficially, replacing the first storage device and the first module with the second storage device and second module do not alter the structure class.
In some embodiments, there is also a framework configured to allow a developer to define the structure class and the complex data types, but does not allow the developer to define the data modeling system base data types
Other aspects and advantages of the present invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating the principles of the invention by way of example only.
The foregoing and other objects, features, and advantages of the present invention, as well as the invention itself, will be more fully understood from the following description of various embodiments, when read together with the accompanying drawings, in which:
For every type of data record in a Catapult-based application (e.g., every piece of information stored in a database), there is a corresponding Model class in the development language provided to and used by a developer. Python is used herein as an example, but any programming language is usable, e.g., C, C++, Java, C#, and the like. The Catapult system provides a Model class and several base classes for developers to create their applications with. Each Model class and the base classes can be transported and persisted to the various data stores available to the Catapult system. Specifically, instances of the Model class are used to interact with data records of that type to retrieve and store data in the data stores. That is, the data records in a data store are accessed and manipulated by manipulating an instance of the Model class. For each field that a data record has, the Model class has a corresponding Property as a class attribute that represents that field. A Property is a generic class that can be extended to provide getters and setters and other functions for the attribute.
The Model class is extended to create custom classes used by a developer in his or her application. In the following examples, the User class provides an example of an implementation of the Model class.
In
This example illustrates a typical shortcoming of some development platforms. Specifically, most data storage solutions can store integer and string fields, but few have natively data structures for geographic points. And it is not a viable option to extend the type system in most storage solutions—databases typically use a fixed number of types, set by the database vendor—so a more practical solution is to store the geographic point as an encoded string, or a series of strings in different columns, and reconstruct the instance into a GeoPt object when retrieving records.
Continuing the GeoPt example, in prior art approaches, the software developer would create software components to store the object by converting the attributes of the GeoPt instances to strings or other data types that were native to the storage device when a “save” or “put” command was issued. Correspondingly, when a “load” or “get” command was issued, the developer would have created software logic to read the individual strings from the database to populate an instance of the GeoPt class. This approach breaks down though when the developer wants to port his code to a storage device that does not support the same data types that the one he is currently using. This would force him to re-architect his code to support the data types of the new storage mechanism.
Catapult's base type system solves this problem. A fixed set of types called the ‘base types’ are defined in one implementation of Catapult, shown in
Other base types could be used, and the invention is not limited to these—they are provided merely as an example of one implementation.
Each Property class in Catapult has a base type as a class attribute, and provides functions to convert the values represented by the Property class to and from that base type, as shown in
When a Property class is more complex than a simple adoption of a base type above, functions for converting the Property class into and out of its BASE_TYPEs are created. In
The BASE_TYPE of the GeoPtProperty class is a “str.” Since the latitude and longitude attributes of the GeoPt class in
Thus, referring back to
The developer does not have to create every complex type (i.e., types that are not base types) for his or her application. Catapult provides a library of pre-defined complex types. As with any developer-created complex type, these complex types have functionality that allows the complex type to be expressed in the form of Catapult's base types.
To illustrate another benefit of the Catapult system,
These model wrappers provide object-oriented access to the data structure in the application runtime. However, they are limited by the fact that the database is ‘flat’, while the natural representation of data records is often hierarchical. Take the example of adding an energy property to the User record, which has attributes of current, max and min. A database representation of this is shown in
The code of
In
Instead, Catapult improves on this approach by providing a super-class of the Model class called a “Structure.” The structure supports the same Property semantics, and allows instances of the Structure class to themselves to be Property values. In
As shown in
Beneficially, the same approach is also applied to moving Structure and Model instances across different transport protocols by passing the instances to different transport drivers instead of storage drivers.
As described above, each data store driver and transport driver in Catapult have established methods of storing and handling each of the base types when the instances are to be stored in the data store or transported. Each complex type attribute is declared as part of the Structure class declaration by attaching a Property instance as a class attribute. This Property instance is responsible for encoding complex values as base values for data storage and transport methods, and for decoding base values to complex values for use in the application. This is accomplished by Catapult “injecting” code into the creation process for that class. Specifically, as the class is being compiled, code is executed which inspects all the class attributes and creates a set of references to the Property instances, and attaches this set to the class. At this point, the code also copies the Property instance references from any parent classes so that standard class inheritance works as expected. Then, after compilation, the compiled Structure class has an attribute that is a set of all of its Property instances, each of which parameterizes a complex type. Then, when Catapult converts the Structure class to a series of base types, it iterates through this set and handles each complex type and its associated value individually. This class-level set of Property instances gives Catapult a well-defined schema for each Structure, which provides the functionality to express the complex types as base types.
During transport and storage, as the schema is parsed, the drivers use the closest matching type that the storage or transport has available. For example, if the storage driver has an int type and the developer's class also has a variable that is an int type, the storage driver will use the int type to store the information held in the variable. If, however, there is not a strict correspondence between types, Catapult will use the most appropriate data storage or transport type for the given variable. For example, if the variable is an Integer (object), and the data storage type has an int type, Catapult will store the value of the Integer object using the int type. The correspondence can be established by referring to a set of known analogous relationships, e.g., storing the relationships in a lookup table. When no correspondence can be made by Catapult, it will store all values as strings, since most data store or transport mechanisms support a string data type. This allows developers store any complex type in any data store and move it across any transport without dependency on the application level.
In
Though the computer program processor is used herein to describe performing all of the steps of receiving the structure class, compiling and inspecting it, encoding it, defining the relationships between the data modeling base types and those of the storage device, and storing of the structure class, it would understood by one of skill in the art that these can be separate processes, e.g., a text editor receives a structure class, a compiler compiles and inspects it, a runtime performs the encoding, etc., and that the term computer program processor is not to be limited to a single processor or process. Furthermore, any of these steps can be combined or performed in an order other than that listed.
Beneficially, the Structure's schema also provides other functionality as well. For example, a digital signature can be generated for each of the complex types on a Structure. The signatures for the complex types can then be combined into a digital signature for the Structure's current schema, which can then be added to saved records as a way of implementing non-linear schema versioning. This versioning would then allow data migration on a per-Structure basis.
The above-described techniques can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. The implementation can be as a computer program product, i.e., a computer program tangibly embodied, e.g., in a non-transitory, machine-readable storage device for execution by, or to control the operation of, data processing apparatus, e.g., a programmable processor, a computer, or multiple computers. A computer program can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, sub-routine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed across multiple sites and interconnected by a communication network.
Method steps can be performed by one or more programmable processors executing a computer program to perform functions of the invention by operating on input data and generating output. Method steps can also be performed by, and an apparatus can be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). Modules can refer to portions of the computer program and/or the processor/special circuitry that implements that functionality.
Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor receives instructions and data from a read-only memory or a random access memory or both. The essential elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Generally, a computer also includes, or is operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. Data transmission and instructions can also occur over a communications network. Information carriers suitable for embodying computer program instructions and data include all forms of non-volatile memory, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in special purpose logic circuitry.
In some embodiments, execution of methods embodied as software limits the computers executing the software described herein to a particular purpose, e.g., providing the data model, inspecting the classes, encoding the complex types, and/or storing the data or other functionality described. In these scenarios, the computers, combined with the software, in effect, becomes a particular machine while the software is executing. In some embodiments, though other tasks may be performed while the software is running, execution of the software still limits the computers and may negatively impact performance of the other tasks. While the software is executing, the computer received classes, inspects them, creates references to its data types, and encodes the data in the complex types using the reference. Furthermore, the encoded complex types are stored using a data store's base types. This effectively transforms the complex types first into base types of the data model, and then again into base types of the data store.
To provide for interaction with a user or administrator, the above described techniques can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer (e.g., interact with a user interface element). Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input.
The above described techniques can be implemented in a distributed computing system that includes a back-end component, e.g., as a data server, and/or a middleware component, e.g., an application server, and/or a front-end component, e.g., a client computer having a graphical user interface and/or a Web browser through which a user can interact with an example implementation, or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (“LAN”) and a wide area network (“WAN”), e.g., the Internet, and include both wired and wireless networks.
The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
The invention has been described in terms of particular embodiments. The alternatives described herein are examples for illustration only and not to limit the alternatives in any way. The steps of the invention can be performed in a different order and still achieve desirable results. Other embodiments are within the scope of the following claims.